home *** CD-ROM | disk | FTP | other *** search
/ Aminet 3 / Aminet 3 - July 1994.iso / Aminet / dev / obero / Interfaces3_4.lha / Interfaces / Intuition.mod < prev    next >
Text File  |  1994-04-16  |  179KB  |  4,117 lines

  1. (*
  2. (*
  3. **  Amiga Oberon Interface Module:
  4. **  $VER: Intuition.mod 40.15 (26.2.94) Oberon 3.3
  5. **
  6. **   © 1993 by Fridtjof Siebert
  7. **   updated for V39, V40 by hartmut Goebel
  8. *)
  9. *)
  10.  
  11. MODULE Intuition;
  12.  
  13. IMPORT
  14.   e  * := Exec,
  15.   g  * := Graphics,
  16.   ie * := InputEvent,
  17.   t  * := Timer,
  18.   u  * := Utility,
  19.   km * := KeyMap,
  20.   y := SYSTEM;
  21.  
  22. TYPE
  23.   MenuPtr          * = UNTRACED POINTER TO Menu;
  24.   MenuItemPtr      * = UNTRACED POINTER TO MenuItem;
  25.   RequesterPtr     * = UNTRACED POINTER TO Requester;
  26.   GadgetPtr        * = UNTRACED POINTER TO Gadget;
  27.   GadSpecialInfoPtr* = UNTRACED POINTER TO GadSpecialInfo;
  28.   BoolInfoPtr      * = UNTRACED POINTER TO BoolInfo;
  29.   PropInfoPtr      * = UNTRACED POINTER TO PropInfo;
  30.   StringInfoPtr    * = UNTRACED POINTER TO StringInfo;
  31.   IntuiTextPtr     * = UNTRACED POINTER TO IntuiText;
  32.   BorderPtr        * = UNTRACED POINTER TO Border;
  33.   ImagePtr         * = UNTRACED POINTER TO Image;
  34.   IntuiMessagePtr  * = UNTRACED POINTER TO IntuiMessage;
  35.   IBoxPtr          * = UNTRACED POINTER TO IBox;
  36.   WindowPtr        * = UNTRACED POINTER TO Window;
  37.   NewWindowPtr     * = UNTRACED POINTER TO NewWindow;
  38.   ExtNewWindowPtr  * = UNTRACED POINTER TO ExtNewWindow;
  39.   RememberPtr      * = UNTRACED POINTER TO Remember;
  40.   ColorSpecPtr     * = UNTRACED POINTER TO ColorSpec;
  41.   EasyStructPtr    * = UNTRACED POINTER TO EasyStruct;
  42.   GadgetInfoPtr    * = UNTRACED POINTER TO GadgetInfo;
  43.   PGXPtr           * = UNTRACED POINTER TO PGX;
  44.   MsgPtr           * = UNTRACED POINTER TO Msg;
  45.   OpSetPtr         * = UNTRACED POINTER TO OpSet;
  46.   OpUpdatePtr      * = UNTRACED POINTER TO OpUpdate;
  47.   OpGetPtr         * = UNTRACED POINTER TO OpGet;
  48.   OpAddTailPtr     * = UNTRACED POINTER TO OpAddTail;
  49.   OpMemberPtr      * = UNTRACED POINTER TO OpMember;
  50.   IClassPtr        * = UNTRACED POINTER TO IClass;
  51.   ObjectPtr        * = UNTRACED POINTER TO Object;
  52.   HitTestPtr       * = UNTRACED POINTER TO HitTest;
  53.   RenderPtr        * = UNTRACED POINTER TO Render;
  54.   InputPtr         * = UNTRACED POINTER TO Input;
  55.   GoInactivePtr    * = UNTRACED POINTER TO GoInactive;
  56.   FrameBoxPtr      * = UNTRACED POINTER TO FrameBox;
  57.   DrawPtr          * = UNTRACED POINTER TO Draw;
  58.   ErasePtr         * = UNTRACED POINTER TO Erase;
  59.   IMHitTestPtr     * = UNTRACED POINTER TO IMHitTest;
  60.   PreferencesPtr   * = UNTRACED POINTER TO Preferences;
  61.   DrawInfoPtr      * = UNTRACED POINTER TO DrawInfo;
  62.   ScreenPtr        * = UNTRACED POINTER TO Screen;
  63.   NewScreenPtr     * = UNTRACED POINTER TO NewScreen;
  64.   ExtNewScreenPtr  * = UNTRACED POINTER TO ExtNewScreen;
  65.   PubScreenNodePtr * = UNTRACED POINTER TO PubScreenNode;
  66.   StringExtendPtr  * = UNTRACED POINTER TO StringExtend;
  67.   SGWorkPtr        * = UNTRACED POINTER TO SGWork;
  68.   IntuitionBasePtr * = UNTRACED POINTER TO IntuitionBase;
  69.   GadgetDummyPtr   * = UNTRACED POINTER TO GadgetDummy;
  70.   ExtGadgetPtr     * = UNTRACED POINTER TO ExtGadget;
  71.   ExtIntuiMessagePtr * = UNTRACED POINTER TO ExtIntuiMessage;
  72.   TabletDataPtr    * = UNTRACED POINTER TO TabletData;
  73.   TabletHookDataPtr * = UNTRACED POINTER TO TabletHookData;
  74.   LayoutPtr        * = UNTRACED POINTER TO Layout;
  75.   ScreenBufferPtr  * = UNTRACED POINTER TO ScreenBuffer;
  76.   DRIPenArrayPtr   * = UNTRACED POINTER TO DRIPenArray;
  77.  
  78. CONST
  79.   intuitionName * = "intuition.library";
  80.  
  81. TYPE
  82. (* ======================================================================== *)
  83. (* === Menu =============================================================== *)
  84. (* ======================================================================== *)
  85.   Menu * = STRUCT
  86.     nextMenu * : MenuPtr;             (* same level *)
  87.     leftEdge * , topEdge * : INTEGER; (* position of the select box *)
  88.     width * , height * : INTEGER;     (* dimensions of the select box *)
  89.     flags * : SET;                    (* see flag definitions below *)
  90.     menuName * : e.LSTRPTR;           (* text for this Menu Header *)
  91.     firstItem * : MenuItemPtr;        (* pointer to first in chain *)
  92.  
  93.     (* these mysteriously-named variables are for internal use only *)
  94.     jazzX * , jazzY * , beatX * , beatY * : INTEGER;
  95.   END;
  96.  
  97. CONST
  98.  
  99. (* FLAGS SET BY BOTH THE APPLIPROG AND INTUITION *)
  100.   menuEnabled * = 0;      (* whether or not this menu is enabled *)
  101.  
  102. (* FLAGS SET BY INTUITION *)
  103.   miDrawn * = 8;          (* this menu's items are currently drawn *)
  104.  
  105.  
  106. TYPE
  107. (* ======================================================================== *)
  108. (* === MenuItem =========================================================== *)
  109. (* ======================================================================== *)
  110.   MenuItem * = STRUCT
  111.     nextItem * : MenuItemPtr;            (* pointer to next in chained list *)
  112.     leftEdge * , topEdge * : INTEGER;    (* position of the select box *)
  113.     width * , height * : INTEGER;        (* dimensions of the select box *)
  114.     flags * : SET;                       (* see the defines below *)
  115.  
  116.     mutualExclude * : LONGSET;           (* set bits mean this item excludes that *)
  117.  
  118.     itemFill * : e.APTR;                 (* points to Image, IntuiText, or NULL *)
  119.  
  120.     (* when this item is pointed to by the cursor and the items highlight
  121.      *  mode HIGHIMAGE is selected, this alternate image will be displayed
  122.      *)
  123.     selectFill * : e.APTR;               (* points to Image, IntuiText, or NULL *)
  124.  
  125.     command * : CHAR;                    (* only if appliprog sets the COMMSEQ flag *)
  126.  
  127.     subItem * : MenuItemPtr;             (* if non-zero, points to MenuItem for submenu *)
  128.  
  129.     (* The NextSelect field represents the menu number of next selected
  130.      *  item (when user has drag-selected several items)
  131.      *)
  132.     nextSelect * : INTEGER;
  133.   END;
  134.  
  135. CONST
  136.  
  137. (* FLAGS SET BY THE APPLIPROG *)
  138.   checkIt         * = 0;  (* set to indicate checkmarkable item *)
  139.   itemText        * = 1;  (* set if textual, clear if graphical item *)
  140.   commSeq         * = 2;  (* set if there's an command sequence *)
  141.   menuToggle      * = 3;  (* set for toggling checks (else mut. exclude) *)
  142.   itemEnabled     * = 4;  (* set if this item is enabled *)
  143.  
  144. (* these are the SPECIAL HIGHLIGHT FLAG state meanings *)
  145.   highFlags       * = {6,7};               (* see definitions below for these bits *)
  146.   highImage       * = {};                  (* use the user's "select image" *)
  147.   highComp        * = 6;                   (* highlight by complementing the selectbox *)
  148.   highBox         * = 7;                   (* highlight by "boxing" the selectbox *)
  149.   highNone        * = {highBox,highComp};  (* don't highlight *)
  150.  
  151. (* FLAGS SET BY BOTH APPLIPROG AND INTUITION *)
  152.   checked         * = 8;  (* state of the checkmark *)
  153.  
  154. (* FLAGS SET BY INTUITION *)
  155.   isDrawn         * = 12; (* this item's subs are currently drawn *)
  156.   highItem        * = 13; (* this item is currently highlighted *)
  157.   menuToggled     * = 14; (* this item was already toggled *)
  158.  
  159.  
  160. TYPE
  161. (* ======================================================================== *)
  162. (* === Requester ========================================================== *)
  163. (* ======================================================================== *)
  164.   Requester * = STRUCT
  165.     olderRequest * : RequesterPtr;
  166.     leftEdge * , topEdge * : INTEGER;   (* dimensions of the entire box *)
  167.     width * , height * : INTEGER;       (* dimensions of the entire box *)
  168.     relLeft * , relTop * : INTEGER;     (* for Pointer relativity offsets *)
  169.  
  170.     reqGadget * : GadgetDummyPtr;       (* pointer to a list of Gadgets *)
  171.     reqBorder * : BorderPtr;            (* the box's border *)
  172.     reqText   * : IntuiTextPtr;         (* the box's text *)
  173.     flags * : SET;                      (* see definitions below *)
  174.  
  175.     (* pen number for back-plane fill before draws *)
  176.     backFill * : SHORTINT;
  177.     (* Layer in place of clip rect      *)
  178.     reqLayer * : g.LayerPtr;
  179.  
  180.     reqPad1 * : ARRAY 32 OF e.BYTE;
  181.  
  182.     (* If the BitMap plane pointers are non-zero, this tells the system
  183.      * that the image comes pre-drawn (if the appliprog wants to define
  184.      * its own box, in any shape or size it wants!);  this is OK by
  185.      * Intuition as long as there's a good correspondence between
  186.      * the image and the specified Gadgets
  187.      *)
  188.     imageBMap * : g.BitMapPtr;          (* points to the BitMap of PREDRAWN imagery *)
  189.     rWindow * : WindowPtr;              (* added.  points back to Window *)
  190.  
  191.     reqImage * : ImagePtr;              (* new for V36: drawn if USEREQIMAGE set *)
  192.  
  193.     reqPad2 * : ARRAY 32 OF e.BYTE;
  194.   END;
  195.  
  196.  
  197. CONST
  198.  
  199. (* FLAGS SET BY THE APPLIPROG *)
  200.   pointRel        * = 0;
  201.                           (* if POINTREL set, TopLeft is relative to pointer
  202.                            * for DMRequester, relative to window center
  203.                            * for Request().
  204.                            *)
  205.   preDrawn        * = 1;
  206.         (* set if Requester.ImageBMap points to predrawn Requester imagery *)
  207.   noisyReq        * = 2;
  208.         (* if you don't want requester to filter input     *)
  209.   simpleReq       * = 4;
  210.         (* to use SIMPLEREFRESH layer (recommended)     *)
  211.  
  212. (* New for V36          *)
  213.   useReqImage     * = 5;
  214.         (*  render linked list ReqImage after BackFill
  215.          * but before gadgets and text
  216.          *)
  217.   noReqBackFill   * = 6;
  218.         (* don't bother filling requester with Requester.BackFill pen   *)
  219.  
  220.  
  221. (* FLAGS SET BY INTUITION *)
  222.   reqOffWindow    * = 12; (* part of one of the Gadgets was offwindow *)
  223.   reqActive       * = 13; (* this requester is active *)
  224.   sysRequest      * = 14; (* this requester caused by system *)
  225.   deferRefresh    * = 15; (* this Requester stops a Refresh broadcast *)
  226.  
  227.  
  228. TYPE
  229. (* ======================================================================== *)
  230. (* === Gadget ============================================================= *)
  231. (* ======================================================================== *)
  232.  
  233.   GadgetDummy * = STRUCT END;    (* dummy base type for Gadget and ExtGadget *)
  234.   GadSpecialInfo * = STRUCT END; (* dummy base type of all SpecialInfos *)
  235.  
  236.   Gadget * = STRUCT (dummy *: GadgetDummy)
  237.     nextGadget * : GadgetDummyPtr;    (* next gadget in the list *)
  238.  
  239.     leftEdge * , topEdge * : INTEGER; (* "hit box" of gadget *)
  240.     width * , height * : INTEGER;     (* "hit box" of gadget *)
  241.  
  242.     flags * : SET;                    (* see below for list of defines *)
  243.  
  244.     activation * : SET;               (* see below for list of defines *)
  245.  
  246.     gadgetType * : INTEGER;           (* see below for defines *)
  247.  
  248.     (* appliprog can specify that the Gadget be rendered as either as Border
  249.      * or an Image.  This variable points to which (or equals NULL if there's
  250.      * nothing to be rendered about this Gadget)
  251.      *)
  252.     gadgetRender * : e.APTR;
  253.  
  254.     (* appliprog can specify "highlighted" imagery rather than algorithmic
  255.      * this can point to either Border or Image data
  256.      *)
  257.     selectRender * : e.APTR;
  258.  
  259.     gadgetText * : IntuiTextPtr;      (* text for this gadget *)
  260.  
  261.     (* MutualExclude, never implemented, is now declared obsolete.
  262.      * There are published examples of implementing a more general
  263.      * and practical exclusion in your applications.
  264.      *
  265.      * Starting with V36, this field is used to point to a hook
  266.      * for a custom gadget.
  267.      *
  268.      * Programs using this field for their own processing will
  269.      * continue to work, as long as they don't try the
  270.      * trick with custom gadgets.
  271.      *)
  272.     mutualExclude * : LONGSET;        (* obsolete *)
  273.  
  274.     (* pointer to a structure of special data required by Proportional,
  275.      * String and Integer Gadgets
  276.      *)
  277.     specialInfo * : GadSpecialInfoPtr;
  278.  
  279.     gadgetID * : INTEGER;             (* user-definable ID field *)
  280.     userData * : e.APTR;              (* ptr to general purpose User data (ignored by In) *)
  281.   END;
  282.  
  283.  
  284. TYPE
  285.   ExtGadget * = STRUCT (dummy *: GadgetDummy)
  286.     nextGadget * : GadgetDummyPtr;     (* Matches struct Gadget *)
  287.     leftEdge * , topEdge * : INTEGER;  (* Matches struct Gadget *)
  288.     width * , height * : INTEGER;      (* Matches struct Gadget *)
  289.     flags * : SET;                     (* Matches struct Gadget *)
  290.     activation * : SET;                (* Matches struct Gadget *)
  291.     gadgetType * : INTEGER;            (* Matches struct Gadget *)
  292.     gadgetRender * : e.APTR;           (* Matches struct Gadget *)
  293.     selectRender * : e.APTR;           (* Matches struct Gadget *)
  294.     gadgetText * : IntuiTextPtr;       (* Matches struct Gadget *)
  295.     mutualExclude * : LONGSET;         (* Matches struct Gadget *)
  296.     specialInfo * : GadSpecialInfoPtr; (* Matches struct Gadget *)
  297.     gadgetID * : INTEGER;              (* Matches struct Gadget *)
  298.     userData * : e.APTR;               (* Matches struct Gadget *)
  299.  
  300.     (* These fields only exist under V39 and only if GFLG_EXTENDED is set *)
  301.     moreFlags      * : LONGSET;        (* see GMORE_ flags below *)
  302.     boundsLeftEdge * : INTEGER;        (* Bounding extent for gadget, valid   *)
  303.     boundsTopEdge  * : INTEGER;        (* only if GMORE_BOUNDS is set.  The   *)
  304.     boundsWidth    * : INTEGER;        (* GFLG_RELxxx flags affect these      *)
  305.     boundsHeight   * : INTEGER;        (* coordinates as well.        *)
  306.   END;
  307.  
  308. CONST
  309. (* --- Gadget.Flags values      --- *)
  310. (* combinations in these bits describe the highlight technique to be used *)
  311.   gadgHighBits * = {0,1};
  312.   gadgHComp    * = {};    (* Complement the select box *)
  313.   gadgHBox     * = 0;     (* Draw a box around the image *)
  314.   gadgHImage   * = 1;     (* Blast in this alternate image *)
  315.   gadgHNone    * = {0,1}; (* don't highlight *)
  316.  
  317.   gadgImage    * = 2;  (* set if GadgetRender and SelectRender
  318.                         * point to an Image structure, clear
  319.                         * if they point to Border structures
  320.                         *)
  321.  
  322. (*  combinations in these next two bits specify to which corner the gadget's
  323.  *  Left & Top coordinates are relative.  If relative to Top/Left,
  324.  *  these are "normal" coordinates (everything is relative to something in
  325.  *  this universe).
  326.  *
  327.  * Gadget positions and dimensions are relative to the window or
  328.  * requester which contains the gadget
  329.  *)
  330.   gRelBottom    * = 3;  (* vert. pos. is relative to bottom edge *)
  331.   gRelRight     * = 4;  (* horiz. pos. is relative to right edge *)
  332.   gRelWidth     * = 5;  (* width is relative to req/window    *)
  333.   gRelHeight    * = 6;  (* height is relative to req/window   *)
  334.  
  335. (* New for V39: GFLG_RELSPECIAL allows custom gadget implementors to
  336.  * make gadgets whose position and size depend in an arbitrary way
  337.  * on their window's dimensions.  The GM_LAYOUT method will be invoked
  338.  * for such a gadget (or any other GREL_xxx gadget) at suitable times,
  339.  * such as when the window opens or the window's size changes.
  340.  *)
  341.   gRelSpecial * =  14;  (* custom gadget has special relativity.
  342.                          * Gadget box values are absolutes, but
  343.                          * can be changed via the GM_LAYOUT method.
  344.                          *)
  345.   selected     * = 7;  (* you may initialize and look at this        *)
  346.  
  347. (* the GFLG_DISABLED flag is initialized by you and later set by Intuition
  348.  * according to your calls to On/OffGadget().  It specifies whether or not
  349.  * this Gadget is currently disabled from being selected
  350.  *)
  351.   gadgDisabled * = 8;
  352.  
  353. (* These flags specify the type of text field that Gadget.GadgetText
  354.  * points to.  In all normal (pre-V36) gadgets which you initialize
  355.  * this field should always be zero.  Some types of gadget objects
  356.  * created from classes will use these fields to keep track of
  357.  * types of labels/contents that different from IntuiText, but are
  358.  * stashed in GadgetText.
  359.  *)
  360.  
  361.   labelMask    * = {12,13};
  362.   labelIText   * = {}; (* GadgetText points to IntuiText     *)
  363.   labelString  * = 12; (* GadgetText points to STRING        *)
  364.   labelImage   * = 13; (* GadgetText points to Image (object)        *)
  365. (* New for V37: GFLG_TABCYCLE *)
  366.   tabCycle     * =  9; (* (string or custom) gadget participates in
  367.                         * cycling activation with Tab or Shift-Tab
  368.                         *)
  369. (* New for V37: GFLG_STRINGEXTEND.  We discovered that V34 doesn't properly
  370.  * ignore the value we had chosen for the Gadget->Activation flag
  371.  * GACT_STRINGEXTEND.  NEVER SET THAT FLAG WHEN RUNNING UNDER V34.
  372.  * The Gadget->Flags bit GFLG_STRINGEXTEND is provided as a synonym which is
  373.  * safe under V34, and equivalent to GACT_STRINGEXTEND under V37.
  374.  * (Note that the two flags are not numerically equal)
  375.  *)
  376.   stringExtend * = 10; (* this String Gadget has StringExtend        *)
  377.  
  378. (* New for V39: GFLG_IMAGEDISABLE.  This flag is automatically set if
  379.  * the custom image of this gadget knows how to do disabled rendering
  380.  * (more specifically, if its IA_SupportsDisable attribute is TRUE).
  381.  * Intuition uses this to defer the ghosting to the image-class,
  382.  * instead of doing it itself (the old compatible way).
  383.  * Do not set this flag yourself - Intuition will do it for you.
  384.  *)
  385.  
  386.   gImagedisable * = 11;  (* Gadget's image knows how to do disabled
  387.                           * rendering
  388.                           *)
  389.  
  390. (* New for V39:  If set, this bit means that the Gadget is actually
  391.  * a struct ExtGadget, with new fields and flags.  All V39 boopsi
  392.  * gadgets are ExtGadgets.  Never ever attempt to read the extended
  393.  * fields of a gadget if this flag is not set.
  394.  *)
  395.   gExtended     * =  15;  (* Gadget is extended *)
  396.  
  397.  
  398. (* ---  Gadget.Activation flag values   --- *)
  399. (* Set GACT_RELVERIFY if you want to verify that the pointer was still over
  400.  * the gadget when the select button was released.  Will cause
  401.  * an IDCMP_GADGETUP message to be sent if so.
  402.  *)
  403.   relVerify    * = 0;
  404.  
  405. (* the flag GACT_IMMEDIATE, when set, informs the caller that the gadget
  406.  *  was activated when it was activated.  This flag works in conjunction with
  407.  *  the GACT_RELVERIFY flag
  408.  *)
  409.   gadgImmediate* = 1;
  410.  
  411. (* the flag GACT_ENDGADGET, when set, tells the system that this gadget,
  412.  * when selected, causes the Requester to be ended.  Requesters
  413.  * that are ended are erased and unlinked from the system.
  414.  *)
  415.   endGadget    * = 2;
  416.  
  417. (* the GACT_FOLLOWMOUSE flag, when set, specifies that you want to receive
  418.  * reports on mouse movements while this gadget is active.
  419.  * You probably want to set the GACT_IMMEDIATE flag when using
  420.  * GACT_FOLLOWMOUSE, since that's the only reasonable way you have of
  421.  * learning why Intuition is suddenly sending you a stream of mouse
  422.  * movement events.  If you don't set GACT_RELVERIFY, you'll get at
  423.  * least one Mouse Position event.
  424.  *)
  425.   followMouse  * = 3;
  426.  
  427. (* if any of the BORDER flags are set in a Gadget that's included in the
  428.  * Gadget list when a Window is opened, the corresponding Border will
  429.  * be adjusted to make room for the Gadget
  430.  *)
  431.   rightBorder  * = 4;
  432.   leftBorder   * = 5;
  433.   topBorder    * = 6;
  434.   bottomBorder * = 7;
  435.   borderSniff  * = 15;  (* neither set nor rely on this bit   *)
  436.  
  437.   toggleSelect * = 8;   (* this bit for toggle-select mode *)
  438.   boolExtend   * = 13;  (* this Boolean Gadget has a BoolInfo *)
  439.  
  440. (* should properly be in StringInfo, but aren't *)
  441.   stringLeft   * = {};  (* NOTE WELL: that this has value zero        *)
  442.   stringCenter * = 9;
  443.   stringRight  * = 10;
  444.   longint      * = 11;  (* this String Gadget is for Long Ints        *)
  445.   altKeyMap    * = 12;  (* this String has an alternate keymap        *)
  446.   actStringExtend * = 13;  (* this String Gadget has StringExtend        *)
  447.                         (* NOTE: NEVER SET GACT_STRINGEXTEND IF YOU
  448.                          * ARE RUNNING ON LESS THAN V36!  SEE
  449.                          * GFLG_STRINGEXTEND (ABOVE) INSTEAD
  450.                          *)
  451.  
  452.  
  453.   activeGadget * = 14; (* this gadget is "active".  This flag
  454.                         * is maintained by Intuition, and you
  455.                         * cannot count on its value persisting
  456.                         * while you do something on your program's
  457.                         * task.  It can only be trusted by
  458.                         * people implementing custom gadgets
  459.                         *)
  460.  
  461. (* note 0x8000 is used above (GACT_BORDERSNIFF);
  462.  * all Activation flags defined *)
  463.  
  464. (* --- GADGET TYPES ------------------------------------------------------- *)
  465. (* These are the Gadget Type definitions for the variable GadgetType
  466.  * gadget number type MUST start from one.  NO TYPES OF ZERO ALLOWED.
  467.  * first comes the mask for Gadget flags reserved for Gadget typing
  468.  *)
  469.   gadgetType * = 0FC00U;  (* all Gadget Global Type flags (padded) *)
  470.   scrGadget  * = 04000U;  (* 1 = ScreenGadget, 0 = WindowGadget *)
  471.   gzzGadget  * = 02000U;  (* 1 = for WFLG_GIMMEZEROZERO borders *)
  472.   reqGadget  * = 01000U;  (* 1 = this is a Requester Gadget *)
  473.  
  474. (* GTYP_SYSGADGET means that Intuition ALLOCATED the gadget.
  475.  * GTYP_SYSTYPEMASK is the mask you can apply to tell what type of
  476.  * system-gadget it is.  The possible types follow.
  477.  *)
  478.  
  479.   sysGadget   * = 08000U;
  480.   sysTypeMask * = 000F0U;
  481.  
  482. (* These definitions describe system gadgets in V36 and higher: *)
  483.   sizing     * = 00010U;   (* Window sizing gadget *)
  484.   wDragging  * = 00020U;   (* Window drag bar      *)
  485.   sDragging  * = 00030U;   (* Screen drag bar      *)
  486.   wDepth     * = 00040U;   (* Window depth gadget  *)
  487.   sDepth     * = 00050U;   (* Screen depth gadget  *)
  488.   wZoom      * = 00060U;   (* Window zoom gadget   *)
  489.   sUnused    * = 00070U;   (* Unused screen gadget *)
  490.   close      * = 00080U;   (* Window close gadget  *)
  491.  
  492. (* These definitions describe system gadgets prior to V36: *)
  493.   wUpFront   * = wDepth;   (* Window to-front gadget *)
  494.   sUpFront   * = sDepth;   (* Screen to-front gadget *)
  495.   wDownBack  * = wZoom;    (* Window to-back gadget  *)
  496.   sDownBack  * = sUnused;  (* Screen to-back gadget  *)
  497.  
  498.   gTypeMask    * = 00007U;
  499.  
  500.   boolGadget   * = 00001U;
  501.   gadget0002   * = 00002U;
  502.   propGadget   * = 00003U;
  503.   strGadget    * = 00004U;
  504.   customGadget * = 00005U;
  505.  
  506. (* This bit in GadgetType is reserved for undocumented internal use
  507.  * by the Gadget Toolkit, and cannot be used nor relied on by
  508.  * applications:        0x0100
  509.  *)
  510.  
  511. (* New for V39.  Gadgets which have the GFLG_EXTENDED flag set are
  512.  * actually ExtGadgets, which have more flags.        The GMORE_xxx
  513.  * identifiers describe those flags.  For GMORE_SCROLLRASTER, see
  514.  * important information in the ScrollWindowRaster() autodoc.
  515.  * NB: GMORE_SCROLLRASTER must be set before the gadget is
  516.  * added to a window.
  517.  *)
  518.   gmoreBounds       * =  0; (* ExtGadget has valid Bounds *)
  519.   gmoreGadgetHelp   * =  1; (* This gadget responds to gadget help *)
  520.   gmoreScrollRaster * =  2; (* This (custom) gadget uses ScrollRaster *)
  521.  
  522.  
  523. TYPE
  524. (* ======================================================================== *)
  525. (* === BoolInfo =========================================================== *)
  526. (* ======================================================================== *)
  527. (* This is the special data needed by an Extended Boolean Gadget
  528.  * Typically this structure will be pointed to by the Gadget field SpecialInfo
  529.  *)
  530.   BoolInfo * = STRUCT (dummy *: GadSpecialInfo)
  531.     flags * : SET;        (* defined below *)
  532.     mask * : e.APTR;      (* bit mask for highlighting and selecting
  533.                            * mask must follow the same rules as an Image
  534.                            * plane.  Its width and height are determined
  535.                            * by the width and height of the gadget's
  536.                            * select box. (i.e. Gadget.Width and .Height).
  537.                            *)
  538.     reserved * : LONGINT; (* set to 0     *)
  539.   END;
  540.  
  541. CONST
  542.  
  543. (* set BoolInfo.Flags to this flag bit.
  544.  * in the future, additional bits might mean more stuff hanging
  545.  * off of BoolInfo.Reserved.
  546.  *)
  547.   boolMask * = 0;   (* extension is for masked gadget *)
  548.  
  549.  
  550. TYPE
  551. (* ======================================================================== *)
  552. (* === PropInfo =========================================================== *)
  553. (* ======================================================================== *)
  554. (* this is the special data required by the proportional Gadget
  555.  * typically, this data will be pointed to by the Gadget variable SpecialInfo
  556.  *)
  557.   PropInfo * = STRUCT (dummy *: GadSpecialInfo)
  558.     flags * : SET;        (* general purpose flag bits (see defines below) *)
  559.  
  560.     (* You initialize the Pot variables before the Gadget is added to
  561.      * the system.  Then you can look here for the current settings
  562.      * any time, even while User is playing with this Gadget.  To
  563.      * adjust these after the Gadget is added to the System, use
  564.      * ModifyProp();  The Pots are the actual proportional settings,
  565.      * where a value of zero means zero and a value of MAXPOT means
  566.      * that the Gadget is set to its maximum setting.
  567.      *)
  568.     horizPot * : INTEGER; (* 16-bit FixedPoint horizontal quantity percentage *)
  569.     vertPot * : INTEGER;  (* 16-bit FixedPoint vertical quantity percentage *)
  570.  
  571.     (* the 16-bit FixedPoint Body variables describe what percentage of
  572.      * the entire body of stuff referred to by this Gadget is actually
  573.      * shown at one time.  This is used with the AUTOKNOB routines,
  574.      * to adjust the size of the AUTOKNOB according to how much of
  575.      * the data can be seen.  This is also used to decide how far
  576.      * to advance the Pots when User hits the Container of the Gadget.
  577.      * For instance, if you were controlling the display of a 5-line
  578.      * Window of text with this Gadget, and there was a total of 15
  579.      * lines that could be displayed, you would set the VertBody value to
  580.      *     (MAXBODY / (TotalLines / DisplayLines)) = MAXBODY / 3.
  581.      * Therefore, the AUTOKNOB would fill 1/3 of the container, and
  582.      * if User hits the Cotainer outside of the knob, the pot would
  583.      * advance 1/3 (plus or minus) If there's no body to show, or
  584.      * the total amount of displayable info is less than the display area,
  585.      * set the Body variables to the MAX.  To adjust these after the
  586.      * Gadget is added to the System, use ModifyProp();
  587.      *)
  588.     horizBody * : INTEGER;           (* horizontal Body *)
  589.     vertBody * : INTEGER;            (* vertical Body *)
  590.  
  591.     (* these are the variables that Intuition sets and maintains *)
  592.     cWidth * : INTEGER;      (* Container width (with any relativity absoluted) *)
  593.     cHeight * : INTEGER;     (* Container height (with any relativity absoluted) *)
  594.     hPotRes * , vPotRes * : INTEGER; (* pot increments *)
  595.     leftBorder * : INTEGER;          (* Container borders *)
  596.     topBorder * : INTEGER;           (* Container borders *)
  597.   END;
  598.  
  599. CONST
  600.  
  601. (* --- FLAG BITS ---------------------------------------------------------- *)
  602.   autoKnob        * = 0;    (* this flag sez:  gimme that old auto-knob *)
  603. (* NOTE: if you do not use an AUTOKNOB for a proportional gadget,
  604.  * you are currently limited to using a single Image of your own
  605.  * design: Intuition won't handle a linked list of images as
  606.  * a proportional gadget knob.
  607.  *)
  608.  
  609.   freeHoriz       * = 1;  (* if set, the knob can move horizontally *)
  610.   freeVert        * = 2;  (* if set, the knob can move vertically *)
  611.   propBorderless  * = 3;  (* if set, no border will be rendered *)
  612.   knobHit         * = 8;  (* set when this Knob is hit *)
  613.   propNewLook     * = 4;  (* set this if you want to get the new
  614.                            * V36 look
  615.                            *)
  616.  
  617.   knobHmin   * = 6;  (* minimum horizontal size of the Knob *)
  618.   knobVmin   * = 4;  (* minimum vertical size of the Knob *)
  619.   maxBody    * = 0FFFFU;  (* maximum body value *)
  620.   maxPot     * = 0FFFFU;  (* maximum pot value *)
  621.  
  622.  
  623. TYPE
  624. (* ======================================================================== *)
  625. (* === StringInfo ========================================================= *)
  626. (* ======================================================================== *)
  627. (* this is the special data required by the string Gadget
  628.  * typically, this data will be pointed to by the Gadget variable SpecialInfo
  629.  *)
  630.   StringInfo * = STRUCT (dummy *: GadSpecialInfo)
  631.     (* you initialize these variables, and then Intuition maintains them *)
  632.     buffer * : e.LSTRPTR;     (* the buffer containing the start and final string *)
  633.     undoBuffer * : e.LSTRPTR; (* optional buffer for undoing current entry *)
  634.     bufferPos * : INTEGER;    (* character position in Buffer *)
  635.     maxChars * : INTEGER;     (* max number of chars in Buffer (including NULL) *)
  636.     dispPos * : INTEGER;      (* Buffer position of first displayed character *)
  637.  
  638.     (* Intuition initializes and maintains these variables for you *)
  639.     undoPos * : INTEGER;      (* character position in the undo buffer *)
  640.     numChars * : INTEGER;     (* number of characters currently in Buffer *)
  641.     dispCount * : INTEGER;    (* number of whole characters visible in Container *)
  642.     cLeft * , cTop * : INTEGER;  (* topleft offset of the container *)
  643.  
  644.     (* This unused field is changed to allow extended specification
  645.      * of string gadget parameters.  It is ignored unless the flag
  646.      * GACT_STRINGEXTEND is set in the Gadget's Activation field
  647.      * or the GFLG_STRINGEXTEND flag is set in the Gadget Flags field.
  648.      * (See GFLG_STRINGEXTEND for an important note)
  649.      *)
  650.     (* layerPtr * : LayerPtr;  --- obsolete --- *)
  651.     extension * : StringExtendPtr;
  652.  
  653.     (* you can initialize this variable before the gadget is submitted to
  654.      * Intuition, and then examine it later to discover what integer
  655.      * the user has entered (if the user never plays with the gadget,
  656.      * the value will be unchanged from your initial setting)
  657.      *)
  658.     longInt * : LONGINT;
  659.  
  660.     (* If you want this Gadget to use your own Console keymapping, you
  661.      * set the GACT_ALTKEYMAP bit in the Activation flags of the Gadget,
  662.      * and then set this variable to point to your keymap.  If you don't
  663.      * set the GACT_ALTKEYMAP, you'll get the standard ASCII keymapping.
  664.      *)
  665.     altKeyMap * : km.KeyMapPtr;
  666.   END;
  667.  
  668.  
  669. (* ======================================================================== *)
  670. (* === IntuiText ========================================================== *)
  671. (* ======================================================================== *)
  672. (* IntuiText is a series of strings that start with a location
  673.  *  (always relative to the upper-left corner of something) and then the
  674.  *  text of the string.  The text is null-terminated.
  675.  *)
  676.   IntuiText * = STRUCT
  677.     frontPen * , backPen * : SHORTINT; (* the pen numbers for the rendering *)
  678.     drawMode * : SHORTSET;             (* the mode for rendering the text *)
  679.     leftEdge * : INTEGER;              (* relative start location for the text *)
  680.     topEdge * : INTEGER;               (* relative start location for the text *)
  681.     iTextFont * : g.TextAttrPtr;       (* if NULL, you accept the default *)
  682.     iText * : e.LSTRPTR;               (* pointer to null-terminated text *)
  683.     nextText * : IntuiTextPtr;         (* pointer to another IntuiText to render *)
  684.   END;
  685.  
  686.  
  687. (* ======================================================================== *)
  688. (* === Border ============================================================= *)
  689. (* ======================================================================== *)
  690. (* Data type Border, used for drawing a series of lines which is intended for
  691.  *  use as a border drawing, but which may, in fact, be used to render any
  692.  *  arbitrary vector shape.
  693.  *  The routine DrawBorder sets up the RastPort with the appropriate
  694.  *  variables, then does a Move to the first coordinate, then does Draws
  695.  *  to the subsequent coordinates.
  696.  *  After all the Draws are done, if NextBorder is non-zero we call DrawBorder
  697.  *  on NextBorder
  698.  *)
  699.   Border * = STRUCT
  700.     leftEdge * , topEdge * : INTEGER;  (* initial offsets from the origin *)
  701.     frontPen * , backPen * : SHORTINT; (* pens numbers for rendering *)
  702.     drawMode * : SHORTSET;             (* mode for rendering *)
  703.     count * : SHORTINT;                (* number of XY pairs *)
  704.     xy * : e.APTR;                     (* vector coordinate pairs rel to LeftTop*)
  705.     nextBorder * : BorderPtr;          (* pointer to any other Border too *)
  706.   END;
  707.  
  708.  
  709. (* ======================================================================== *)
  710. (* === Image ============================================================== *)
  711. (* ======================================================================== *)
  712. (* This is a brief image structure for very simple transfers of
  713.  * image data to a RastPort
  714.  *)
  715.   Image * = STRUCT
  716.     leftEdge * : INTEGER;             (* starting offset relative to some origin *)
  717.     topEdge * : INTEGER;              (* starting offsets relative to some origin *)
  718.     width * : INTEGER;                (* pixel size (though data is word-aligned) *)
  719.     height * : INTEGER;
  720.     depth * : INTEGER;                (* >= 0, for images you create          *)
  721.     imageData * : e.APTR;             (* pointer to the actual word-aligned bits *)
  722.  
  723.     (* the PlanePick and PlaneOnOff variables work much the same way as the
  724.      * equivalent GELS Bob variables.  It's a space-saving
  725.      * mechanism for image data.  Rather than defining the image data
  726.      * for every plane of the RastPort, you need define data only
  727.      * for the planes that are not entirely zero or one.  As you
  728.      * define your Imagery, you will often find that most of the planes
  729.      * ARE just as color selectors.  For instance, if you're designing
  730.      * a two-color Gadget to use colors one and three, and the Gadget
  731.      * will reside in a five-plane display, bit plane zero of your
  732.      * imagery would be all ones, bit plane one would have data that
  733.      * describes the imagery, and bit planes two through four would be
  734.      * all zeroes.  Using these flags avoids wasting all
  735.      * that memory in this way:  first, you specify which planes you
  736.      * want your data to appear in using the PlanePick variable.  For
  737.      * each bit set in the variable, the next "plane" of your image
  738.      * data is blitted to the display.  For each bit clear in this
  739.      * variable, the corresponding bit in PlaneOnOff is examined.
  740.      * If that bit is clear, a "plane" of zeroes will be used.
  741.      * If the bit is set, ones will go out instead.  So, for our example:
  742.      *   Gadget.PlanePick = 0x02;
  743.      *   Gadget.PlaneOnOff = 0x01;
  744.      * Note that this also allows for generic Gadgets, like the
  745.      * System Gadgets, which will work in any number of bit planes.
  746.      * Note also that if you want an Image that is only a filled
  747.      * rectangle, you can get this by setting PlanePick to zero
  748.      * (pick no planes of data) and set PlaneOnOff to describe the pen
  749.      * color of the rectangle.
  750.      *
  751.      * NOTE:  Intuition relies on PlanePick to know how many planes
  752.      * of data are found in ImageData.  There should be no more
  753.      * '1'-bits in PlanePick than there are planes in ImageData.
  754.      *)
  755.     planePick * , planeOnOff * : SHORTSET;
  756.  
  757.     (* if the NextImage variable is not NULL, Intuition presumes that
  758.      * it points to another Image structure with another Image to be
  759.      * rendered
  760.      *)
  761.     nextImage * : ImagePtr;
  762.   END;
  763.  
  764.  
  765. (* ======================================================================== *)
  766. (* === IntuiMessage ======================================================= *)
  767. (* ======================================================================== *)
  768.   IntuiMessage * = STRUCT (execMessage * : e.Message)
  769.  
  770.     (* the Class bits correspond directly with the IDCMP Flags, except for the
  771.      * special bit IDCMP_LONELYMESSAGE (defined below)
  772.      *)
  773.     class * : LONGSET;
  774.  
  775.     (* the Code field is for special values like MENU number *)
  776.     code * : INTEGER;
  777.  
  778.     (* the Qualifier field is a copy of the current InputEvent's Qualifier *)
  779.     qualifier * : SET;
  780.  
  781.     (* IAddress contains particular addresses for Intuition functions, like
  782.      * the pointer to the Gadget or the Screen
  783.      *)
  784.     iAddress * : e.APTR;
  785.  
  786.     (* when getting mouse movement reports, any event you get will have the
  787.      * the mouse coordinates in these variables.  the coordinates are relative
  788.      * to the upper-left corner of your Window (WFLG_GIMMEZEROZERO
  789.      * notwithstanding).  If IDCMP_DELTAMOVE is set, these values will
  790.      * be deltas from the last reported position.
  791.      *)
  792.     mouseX * , mouseY * : INTEGER;
  793.  
  794.     (* the time values are copies of the current system clock time.  Micros
  795.      * are in units of microseconds, Seconds in seconds.
  796.      *)
  797.     time * : t.TimeVal;
  798.  
  799.     (* the IDCMPWindow variable will always have the address of the Window of
  800.      * this IDCMP
  801.      *)
  802.     idcmpWindow * : WindowPtr;
  803.  
  804.     (* system-use variable *)
  805.     specialLink * : IntuiMessagePtr;
  806.   END;
  807.  
  808. (* New for V39:
  809.  * All IntuiMessages are now slightly extended.  The ExtIntuiMessage
  810.  * structure has an additional field for tablet data, which is usually
  811.  * NULL.  If a tablet driver which is sending IESUBCLASS_NEWTABLET
  812.  * events is installed in the system, windows with the WA_TabletMessages
  813.  * property set will find that eim_TabletData points to the TabletData
  814.  * structure.  Applications must first check that this field is non-NULL;
  815.  * it will be NULL for certain kinds of message, including mouse activity
  816.  * generated from other than the tablet (i.e. the keyboard equivalents
  817.  * or the mouse itself).
  818.  *
  819.  * NEVER EVER examine any extended fields when running under pre-V39!
  820.  *
  821.  * NOTE: This structure is subject to grow in the future.  Making
  822.  * assumptions about its size is A BAD IDEA.
  823.  *)
  824.  
  825.   ExtIntuiMessage * = STRUCT (intuiMessage *: IntuiMessage)
  826.     tabletData * : TabletDataPtr;
  827.   END;
  828.  
  829.  
  830. CONST
  831. (* --- IDCMP Classes ------------------------------------------------------ *)
  832. (* Please refer to the Autodoc for OpenWindow() and to the Rom Kernel
  833.  * Manual for full details on the IDCMP classes.
  834.  *)
  835.   sizeVerify        * = 0;
  836.   newSize           * = 1;
  837.   refreshWindow     * = 2;
  838.   mouseButtons      * = 3;
  839.   mouseMove         * = 4;
  840.   gadgetDown        * = 5;
  841.   gadgetUp          * = 6;
  842.   reqSet            * = 7;
  843.   menuPick          * = 8;
  844.   closeWindow       * = 9;
  845.   rawKey            * = 10;
  846.   reqVerify         * = 11;
  847.   reqClear          * = 12;
  848.   menuVerify        * = 13;
  849.   newPrefs          * = 14;
  850.   diskInserted      * = 15;
  851.   diskRemoved       * = 16;
  852.   wbenchMessage       = 17;  (*  System use only         *)
  853.   activeWindow      * = 18;
  854.   inactiveWindow    * = 19;
  855.   deltaMove         * = 20;
  856.   vanillaKey        * = 21;
  857.   intuiTicks        * = 22;
  858. (* for notifications from "boopsi" gadgets       *)
  859.   idcmpUpdate       * = 23;  (* new for V36      *)
  860. (* for getting help key report during menu session  *)
  861.   menuHelp          * = 24;  (* new for V36      *)
  862. (* for notification of any move/size/zoom/change window *)
  863.   changeWindow      * = 25;  (* new for V36      *)
  864.   gadgetHelp        * = 26;  (* new for V39      *)
  865.  
  866. (* NOTEZ-BIEN:          31   is reserved for internal use   *)
  867.  
  868. (* the IDCMP Flags do not use this special bit, which is cleared when
  869.  * Intuition sends its special message to the Task, and set when Intuition
  870.  * gets its Message back from the Task.  Therefore, I can check here to
  871.  * find out fast whether or not this Message is available for me to send
  872.  *)
  873.   lonelyMessage     * = 31;
  874.  
  875.  
  876. (* --- IDCMP Codes -------------------------------------------------------- *)
  877. (* This group of codes is for the IDCMP_CHANGEWINDOW message *)
  878.   cwcodeMoveSize * =  0000H;  (* Window was moved and/or sized *)
  879.   cwcodeDepth    * =  0001H;  (* Window was depth-arranged (new for V39) *)
  880.  
  881. (* This group of codes is for the IDCMP_MENUVERIFY function *)
  882.   menuHot         * = 0001H;  (* Intui wants verification or MENUCANCEL   *)
  883.   menuCancel      * = 0002H;  (* HOT Reply of this cancels Menu operation *)
  884.   menuWaiting     * = 0003H;  (* Intuition simply wants a ReplyMsg() ASAP *)
  885.  
  886. (* These are internal tokens to represent state of verification attempts
  887.  * shown here as a clue.
  888.  *)
  889.   okOk            * = menuHot;    (* guy didn't care                      *)
  890.   okAbort         * = 0004H;      (* window rendered question moot        *)
  891.   okCancel        * = menuCancel; (* window sent cancel reply          *)
  892.  
  893. (* This group of codes is for the IDCMP_WBENCHMESSAGE messages *)
  894.   wbenchOpen      * = 0001H;
  895.   wbenchClose     * = 0002H;
  896.  
  897.  
  898. TYPE
  899.  
  900. (* A data structure common in V36 Intuition processing   *)
  901.   IBox * = STRUCT
  902.     left * : INTEGER;
  903.     top * : INTEGER;
  904.     width * : INTEGER;
  905.     height * : INTEGER;
  906.   END;
  907.  
  908.  
  909. (* ======================================================================== *)
  910. (* === Window ============================================================= *)
  911. (* ======================================================================== *)
  912.   Window * = STRUCT
  913.     nextWindow * : WindowPtr;           (* for the linked list in a screen *)
  914.  
  915.     leftEdge * , topEdge * : INTEGER;   (* screen dimensions of window *)
  916.     width * , height * : INTEGER;       (* screen dimensions of window *)
  917.  
  918.     mouseY * , mouseX * : INTEGER;      (* relative to upper-left of window *)
  919.  
  920.     minWidth * , minHeight * : INTEGER; (* minimum sizes *)
  921.     maxWidth * , maxHeight * : INTEGER; (* maximum sizes *)
  922.  
  923.     flags * : LONGSET;                  (* see below for defines *)
  924.  
  925.     menuStrip * : MenuPtr;              (* the strip of Menu headers *)
  926.  
  927.     title * : e.LSTRPTR;                (* the title text for this window *)
  928.  
  929.     firstRequest * : RequesterPtr;      (* all active Requesters *)
  930.  
  931.     dmRequest * : RequesterPtr;         (* double-click Requester *)
  932.  
  933.     reqCount * : INTEGER;               (* count of reqs blocking Window *)
  934.  
  935.     wScreen * : ScreenPtr;              (* this Window's Screen *)
  936.     rPort * : g.RastPortPtr;            (* this Window's very own RastPort *)
  937.  
  938.     (* the border variables describe the window border.  If you specify
  939.      * WFLG_GIMMEZEROZERO when you open the window, then the upper-left of
  940.      * the ClipRect for this window will be upper-left of the BitMap (with
  941.      * correct offsets when in SuperBitMap mode; you MUST select
  942.      * WFLG_GIMMEZEROZERO when using SuperBitMap).  If you don't specify
  943.      * ZeroZero, then you save memory (no allocation of RastPort, Layer,
  944.      * ClipRect and associated Bitmaps), but you also must offset all your
  945.      * writes by BorderTop, BorderLeft and do your own mini-clipping to
  946.      * prevent writing over the system gadgets
  947.      *)
  948.     borderLeft * , borderTop * , borderRight * , borderBottom * : SHORTINT;
  949.     borderRPort * : g.RastPortPtr;
  950.  
  951.  
  952.     (* You supply a linked-list of Gadgets for your Window.
  953.      * This list DOES NOT include system gadgets.  You get the standard
  954.      * window system gadgets by setting flag-bits in the variable Flags (see
  955.      * the bit definitions below)
  956.      *)
  957.     firstGadget * : GadgetDummyPtr;
  958.  
  959.     (* these are for opening/closing the windows *)
  960.     parent * , descendant * : WindowPtr;
  961.  
  962.     (* sprite data information for your own Pointer
  963.      * set these AFTER you Open the Window by calling SetPointer()
  964.      *)
  965.     pointer * : e.APTR;    (* sprite data *)
  966.     ptrHeight * : SHORTINT;     (* sprite height (not including sprite padding) *)
  967.     ptrWidth * : SHORTINT;      (* sprite width (must be less than or equal to 16) *)
  968.     xOffset * , yOffset * : SHORTINT;      (* sprite offsets *)
  969.  
  970.     (* the IDCMP Flags and User's and Intuition's Message Ports *)
  971.     idcmpFlags * : LONGSET;   (* User-selected flags *)
  972.     userPort * : e.MsgPortPtr;
  973.     windowPort * : e.MsgPortPtr;
  974.     messageKey * : IntuiMessagePtr;
  975.  
  976.     detailPen * , blockPen * : SHORTINT;  (* for bar/border/gadget rendering *)
  977.  
  978.     (* the CheckMark is a pointer to the imagery that will be used when
  979.      * rendering MenuItems of this Window that want to be checkmarked
  980.      * if this is equal to NULL, you'll get the default imagery
  981.      *)
  982.     checkMark * : ImagePtr;
  983.  
  984.     screenTitle * : e.LSTRPTR; (* if non-null, Screen title when Window is active *)
  985.  
  986.     (* These variables have the mouse coordinates relative to the
  987.      * inner-Window of WFLG_GIMMEZEROZERO Windows.  This is compared with the
  988.      * MouseX and MouseY variables, which contain the mouse coordinates
  989.      * relative to the upper-left corner of the Window, WFLG_GIMMEZEROZERO
  990.      * notwithstanding
  991.      *)
  992.     gzzMouseX * : INTEGER;
  993.     gzzMouseY * : INTEGER;
  994.     (* these variables contain the width and height of the inner-Window of
  995.      * WFLG_GIMMEZEROZERO Windows
  996.      *)
  997.     gzzWidth * : INTEGER;
  998.     gzzHeight * : INTEGER;
  999.  
  1000.     extData * : e.APTR;
  1001.  
  1002.     userData * : e.APTR;     (* general-purpose pointer to User data extension *)
  1003.  
  1004.     (* 11/18/85: this pointer keeps a duplicate of what
  1005.      * Window.RPort->Layer is _supposed_ to be pointing at
  1006.      *)
  1007.     wLayer * : g.LayerPtr;
  1008.  
  1009.     (* NEW 1.2: need to keep track of the font that
  1010.      * OpenWindow opened, in case user SetFont's into RastPort
  1011.      *)
  1012.     iFont * : g.TextFontPtr;
  1013.  
  1014.     (* (V36) another flag word (the Flags field is used up).
  1015.      * At present, all flag values are system private.
  1016.      * Until further notice, you may not change nor use this field.
  1017.      *)
  1018.     moreFlags   : LONGSET;
  1019.  
  1020.     (**** Data beyond this point are Intuition Private.  DO NOT USE ****)
  1021.   END;
  1022.  
  1023. CONST
  1024. (* --- Flags requested at OpenWindow() time by the application --------- *)
  1025.   windowSizing   * = 0;      (* include sizing system-gadget? *)
  1026.   windowDrag     * = 1;      (* include dragging system-gadget? *)
  1027.   windowDepth    * = 2;      (* include depth arrangement gadget? *)
  1028.   windowClose    * = 3;      (* include close-box system-gadget? *)
  1029.  
  1030.   sizeBRight     * = 4;      (* size gadget uses right border *)
  1031.   sizeBBottom    * = 5;      (* size gadget uses bottom border *)
  1032.  
  1033. (* --- refresh modes ------------------------------------------------------ *)
  1034. (* combinations of the WFLG_REFRESHBITS select the refresh type *)
  1035.   refreshBits    * = LONGSET{6,7};
  1036.   smartRefresh   * = LONGSET{};
  1037.   simpleRefresh  * = 6;
  1038.   superBitMap    * = 7;
  1039.   otherRefresh   * = LONGSET{6,7};
  1040.  
  1041.   backDrop       * = 8;      (* this is a backdrop window *)
  1042.  
  1043.   reportMouse    * = 9;      (* to hear about every mouse move *)
  1044.  
  1045.   gimmeZeroZero  * = 10;     (* a GimmeZeroZero window       *)
  1046.  
  1047.   borderless     * = 11;     (* to get a Window sans border *)
  1048.  
  1049.   activate       * = 12;     (* when Window opens, it's Active *)
  1050.  
  1051. (* --- Other User Flags --------------------------------------------------- *)
  1052.   rmbTrap        * = 16;     (* Catch RMB events for your own *)
  1053.   noCareRefresh  * = 17;     (* not to be bothered with REFRESH *)
  1054.  
  1055. (* - V36 new Flags which the programmer may specify in NewWindow.Flags  *)
  1056.   nwExtended     * = 18;     (* extension data provided      *)
  1057.  
  1058. (* - V39 new Flags which the programmer may specify in NewWindow.Flags        *)
  1059.   newLookMenus   * = 21;     (* window has NewLook menus     *)
  1060.  
  1061.  
  1062. (* These flags are set only by Intuition.  YOU MAY NOT SET THEM YOURSELF! *)
  1063.   windowActive   * = 13;     (* this window is the active one *)
  1064.   inRequest      * = 14;     (* this window is in request mode *)
  1065.   menuState      * = 15;     (* Window is active with Menus on *)
  1066.   windowRefresh  * = 24;     (* Window is currently refreshing *)
  1067.   wbenchWindow   * = 25;     (* WorkBench tool ONLY Window *)
  1068.   windowTicked   * = 26;     (* only one timer tick at a time *)
  1069.  
  1070. (* V36 and higher flags to be set only by Intuition: *)
  1071.   visitor        * = 27;     (* visitor window               *)
  1072.   zoomed         * = 28;     (* identifies "zoom state"      *)
  1073.   hasZoom        * = 29;     (* windowhas a zoom gadget      *)
  1074.  
  1075. (* --- Other Window Values ---------------------------------------------- *)
  1076.   defaultMouseQueue * = 5;        (* no more mouse messages       *)
  1077.  
  1078. (* --- see struct IntuiMessage for the IDCMP Flag definitions ------------- *)
  1079.  
  1080.  
  1081. TYPE
  1082. (* ======================================================================== *)
  1083. (* === NewWindow ========================================================== *)
  1084. (* ======================================================================== *)
  1085. (*
  1086.  * Note that the new extension fields have been removed.  Use ExtNewWindow
  1087.  * structure below to make use of these fields
  1088.  *)
  1089.   NewWindow * = STRUCT
  1090.     leftEdge * , topEdge * : INTEGER;     (* screen dimensions of window *)
  1091.     width * , height * : INTEGER;         (* screen dimensions of window *)
  1092.  
  1093.     detailPen * , blockPen * : SHORTINT;  (* for bar/border/gadget rendering *)
  1094.  
  1095.     idcmpFlags * : LONGSET;               (* User-selected IDCMP flags *)
  1096.  
  1097.     flags * : LONGSET;                    (* see Window struct for defines *)
  1098.  
  1099.     (* You supply a linked-list of Gadgets for your Window.
  1100.      *  This list DOES NOT include system Gadgets.  You get the standard
  1101.      *  system Window Gadgets by setting flag-bits in the variable Flags (see
  1102.      *  the bit definitions under the Window structure definition)
  1103.      *)
  1104.     firstGadget * : GadgetDummyPtr;
  1105.  
  1106.     (* the CheckMark is a pointer to the imagery that will be used when
  1107.      * rendering MenuItems of this Window that want to be checkmarked
  1108.      * if this is equal to NULL, you'll get the default imagery
  1109.      *)
  1110.     checkMark * : ImagePtr;
  1111.  
  1112.     title * : e.LSTRPTR;                  (* the title text for this window *)
  1113.  
  1114.     (* the Screen pointer is used only if you've defined a CUSTOMSCREEN and
  1115.      * want this Window to open in it.  If so, you pass the address of the
  1116.      * Custom Screen structure in this variable.  Otherwise, this variable
  1117.      * is ignored and doesn't have to be initialized.
  1118.      *)
  1119.     screen * : ScreenPtr;
  1120.  
  1121.     (* WFLG_SUPER_BITMAP Window?  If so, put the address of your BitMap
  1122.      * structure in this variable.  If not, this variable is ignored and
  1123.      * doesn't have to be initialized
  1124.      *)
  1125.     bitMap * : g.BitMapPtr;
  1126.  
  1127.     (* the values describe the minimum and maximum sizes of your Windows.
  1128.      * these matter only if you've chosen the WFLG_SIZEGADGET option,
  1129.      * which means that you want to let the User to change the size of
  1130.      * this Window.  You describe the minimum and maximum sizes that the
  1131.      * Window can grow by setting these variables.  You can initialize
  1132.      * any one these to zero, which will mean that you want to duplicate
  1133.      * the setting for that dimension (if MinWidth == 0, MinWidth will be
  1134.      * set to the opening Width of the Window).
  1135.      * You can change these settings later using SetWindowLimits().
  1136.      * If you haven't asked for a SIZING Gadget, you don't have to
  1137.      * initialize any of these variables.
  1138.      *)
  1139.     minWidth * , minHeight * : INTEGER;       (* minimums *)
  1140.     maxWidth * , maxHeight * : INTEGER;       (* maximums *)
  1141.  
  1142.     (* the type variable describes the Screen in which you want this Window to
  1143.      * open.  The type value can either be CUSTOMSCREEN or one of the
  1144.      * system standard Screen Types such as WBENCHSCREEN.  See the
  1145.      * type definitions under the Screen structure.
  1146.      *)
  1147.     type * : SET;
  1148.   END;
  1149.  
  1150. (* The following structure is the future NewWindow.  Compatibility
  1151.  * issues require that the size of NewWindow not change.
  1152.  * Data in the common part (NewWindow) indicates the the extension
  1153.  * fields are being used.
  1154.  * NOTE WELL: This structure may be subject to future extension.
  1155.  * Writing code depending on its size is not allowed.
  1156.  *)
  1157.   ExtNewWindow * = STRUCT (nw * : NewWindow)
  1158.  
  1159.     (* ------------------------------------------------------- *
  1160.      * extensions for V36
  1161.      * if the NewWindow Flag value WFLG_NW_EXTENDED is set, then
  1162.      * this field is assumed to point to an array ( or chain of arrays)
  1163.      * of TagItem structures.  See also ExtNewScreen for another
  1164.      * use of TagItems to pass optional data.
  1165.      *
  1166.      * see below for tag values and the corresponding data.
  1167.      *)
  1168.     extension * : u.TagListPtr;
  1169.   END;
  1170.  
  1171. CONST
  1172. (*
  1173.  * The TagItem ID's (ti_Tag values) for OpenWindowTagList() follow.
  1174.  * They are values in a TagItem array passed as extension/replacement
  1175.  * values for the data in NewWindow.  OpenWindowTagList() can actually
  1176.  * work well with a NULL NewWindow pointer.
  1177.  *)
  1178.  
  1179.   waDummy            * = u.user + 99;  (* 0x80000063   *)
  1180.  
  1181. (* these tags simply override NewWindow parameters *)
  1182.   waLeft             * = waDummy + 001H;
  1183.   waTop              * = waDummy + 002H;
  1184.   waWidth            * = waDummy + 003H;
  1185.   waHeight           * = waDummy + 004H;
  1186.   waDetailPen        * = waDummy + 005H;
  1187.   waBlockPen         * = waDummy + 006H;
  1188.   waIDCMP            * = waDummy + 007H;
  1189.                   (* "bulk" initialization of NewWindow.Flags *)
  1190.   waFlags            * = waDummy + 008H;
  1191.   waGadgets          * = waDummy + 009H;
  1192.   waCheckmark        * = waDummy + 00AH;
  1193.   waTitle            * = waDummy + 00BH;
  1194.                   (* means you don't have to call SetWindowTitles
  1195.                    * after you open your window
  1196.                    *)
  1197.   waScreenTitle      * = waDummy + 00CH;
  1198.   waCustomScreen     * = waDummy + 00DH;
  1199.   waSuperBitMap      * = waDummy + 00EH;
  1200.                   (* also implies WFLG_SUPER_BITMAP property      *)
  1201.   waMinWidth         * = waDummy + 00FH;
  1202.   waMinHeight        * = waDummy + 010H;
  1203.   waMaxWidth         * = waDummy + 011H;
  1204.   waMaxHeight        * = waDummy + 012H;
  1205.  
  1206. (* The following are specifications for new features    *)
  1207.  
  1208.   waInnerWidth       * = waDummy + 013H;
  1209.   waInnerHeight      * = waDummy + 014H;
  1210.                   (* You can specify the dimensions of the interior
  1211.                    * region of your window, independent of what
  1212.                    * the border widths will be.  You probably want
  1213.                    * to also specify WA_AutoAdjust to allow
  1214.                    * Intuition to move your window or even
  1215.                    * shrink it so that it is completely on screen.
  1216.                    *)
  1217.  
  1218.   waPubScreenName    * = waDummy + 015H;
  1219.                   (* declares that you want the window to open as
  1220.                    * a visitor on the public screen whose name is
  1221.                    * pointed to by (UBYTE * )  ti_Data
  1222.                    *)
  1223.   waPubScreen        * = waDummy + 016H;
  1224.                   (* open as a visitor window on the public screen
  1225.                    * whose address is in (struct Screen * ) ti_Data.
  1226.                    * To ensure that this screen remains open, you
  1227.                    * should either be the screen's owner, have a
  1228.                    * window open on the screen, or use LockPubScreen().
  1229.                    *)
  1230.   waPubScreenFallBack* = waDummy + 017H;
  1231.                   (* A Boolean, specifies whether a visitor window
  1232.                    * should "fall back" to the default public screen
  1233.                    * (or Workbench) if the named public screen isn't
  1234.                    * available
  1235.                    *)
  1236.   waWindowName       * = waDummy + 018H;
  1237.                   (* not implemented      *)
  1238.   waColors           * = waDummy + 019H;
  1239.                   (* a ColorSpec array for colors to be set
  1240.                    * when this window is active.  This is not
  1241.                    * implemented, and may not be, since the default
  1242.                    * values to restore would be hard to track.
  1243.                    * We'd like to at least support per-window colors
  1244.                    * for the mouse pointer sprite.
  1245.                    *)
  1246.   waZoom             * = waDummy + 01AH;
  1247.                   (* ti_Data points to an array of four WORD's,
  1248.                    * the initial Left/Top/Width/Height values of
  1249.                    * the "alternate" zoom position/dimensions.
  1250.                    * It also specifies that you want a Zoom gadget
  1251.                    * for your window, whether or not you have a
  1252.                    * sizing gadget.
  1253.                    *)
  1254.   waMouseQueue       * = waDummy + 01BH;
  1255.                   (* ti_Data contains initial value for the mouse
  1256.                    * message backlog limit for this window.
  1257.                    *)
  1258.   waBackFill         * = waDummy + 01CH;
  1259.                   (* provides a "backfill hook" for your window's Layer.
  1260.                    * See layers.library/CreateUpfrontHookLayer().
  1261.                    *)
  1262.   waRptQueue         * = waDummy + 01DH;
  1263.                   (* initial value of repeat key backlog limit    *)
  1264.  
  1265.   (* These Boolean tag items are alternatives to the NewWindow.Flags
  1266.    * boolean flags with similar names.
  1267.    *)
  1268.   waSizeGadget       * = waDummy + 01EH;
  1269.   waDragBar          * = waDummy + 01FH;
  1270.   waDepthGadget      * = waDummy + 020H;
  1271.   waCloseGadget      * = waDummy + 021H;
  1272.   waBackdrop         * = waDummy + 022H;
  1273.   waReportMouse      * = waDummy + 023H;
  1274.   waNoCareRefresh    * = waDummy + 024H;
  1275.   waBorderless       * = waDummy + 025H;
  1276.   waActivate         * = waDummy + 026H;
  1277.   waRMBTrap          * = waDummy + 027H;
  1278.   waWBenchWindow     * = waDummy + 028H;      (* PIVATE!!! *)
  1279.   waSimpleRefresh    * = waDummy + 029H;
  1280.                   (* only specify if TRUE *)
  1281.   waSmartRefresh     * = waDummy + 02AH;
  1282.                   (* only specify if TRUE *)
  1283.   waSizeBRight       * = waDummy + 02BH;
  1284.   waSizeBBottom      * = waDummy + 02CH;
  1285.  
  1286.   (* New Boolean properties   *)
  1287.   waAutoAdjust       * = waDummy + 02DH;
  1288.                   (* shift or squeeze the window's position and
  1289.                    * dimensions to fit it on screen.
  1290.                    *)
  1291.  
  1292.   waGimmeZeroZero    * = waDummy + 02EH;
  1293.                   (* equiv. to NewWindow.Flags WFLG_GIMMEZEROZERO *)
  1294.  
  1295. (* New for V37: WA_MenuHelp (ignored by V36) *)
  1296.   waMenuHelp         * = waDummy + 02FH;
  1297.                   (* Enables IDCMP_MENUHELP:  Pressing HELP during menus
  1298.                    * will return IDCMP_MENUHELP message.
  1299.                    *)
  1300. (* New for V39:  (ignored by V37 and earlier) *)
  1301.   waNewLookMenus     * = waDummy + 030H;
  1302.                       (* Set to TRUE if you want NewLook menus *)
  1303.   waAmigaKey         * = waDummy + 031H;
  1304.                       (* Pointer to image for Amiga-key equiv in menus *)
  1305.   waNotifyDepth      * = waDummy + 032H;
  1306.                       (* Requests IDCMP_CHANGEWINDOW message when
  1307.                        * window is depth arranged
  1308.                        * (imsg->Code = CWCODE_DEPTH)
  1309.                        *)
  1310.  
  1311. (* WA_Dummy + 033 is obsolete *)
  1312.  
  1313.   waPointer          * = waDummy + 034H;
  1314.                       (* Allows you to specify a custom pointer
  1315.                        * for your window.  ti_Data points to a
  1316.                        * pointer object you obtained via
  1317.                        * "pointerclass". NULL signifies the
  1318.                        * default pointer.
  1319.                        * This tag may be passed to OpenWindowTags()
  1320.                        * or SetWindowPointer().
  1321.                        *)
  1322.  
  1323.   waBusyPointer      * = waDummy + 035H;
  1324.                       (* ti_Data is boolean.  Set to TRUE to
  1325.                        * request the standard busy pointer.
  1326.                        * This tag may be passed to OpenWindowTags()
  1327.                        * or SetWindowPointer().
  1328.                        *)
  1329.  
  1330.   waPointerDelay     * = waDummy + 036H;
  1331.                       (* ti_Data is boolean.  Set to TRUE to
  1332.                        * request that the changing of the
  1333.                        * pointer be slightly delayed.  The change
  1334.                        * will be called off if you call NewSetPointer()
  1335.                        * before the delay expires.  This allows
  1336.                        * you to post a busy-pointer even if you think
  1337.                        * the busy-time may be very short, without
  1338.                        * fear of a flashing pointer.
  1339.                        * This tag may be passed to OpenWindowTags()
  1340.                        * or SetWindowPointer().
  1341.                        *)
  1342.  
  1343.   waTabletMessages   * = waDummy + 037H;
  1344.                       (* ti_Data is a boolean.  Set to TRUE to
  1345.                        * request that tablet information be included
  1346.                        * in IntuiMessages sent to your window.
  1347.                        * Requires that something (i.e. a tablet driver)
  1348.                        * feed IESUBCLASS_NEWTABLET InputEvents into
  1349.                        * the system.  For a pointer to the TabletData,
  1350.                        * examine the ExtIntuiMessage->eim_TabletData
  1351.                        * field.  It is UNSAFE to check this field
  1352.                        * when running on pre-V39 systems.  It's always
  1353.                        * safe to check this field under V39 and up,
  1354.                        * though it may be NULL.
  1355.                        *)
  1356.  
  1357.   waHelpGroup        * = waDummy + 038H;
  1358.                       (* When the active window has gadget help enabled,
  1359.                        * other windows of the same HelpGroup number
  1360.                        * will also get GadgetHelp.  This allows GadgetHelp
  1361.                        * to work for multi-windowed applications.
  1362.                        * Use GetGroupID() to get an ID number.  Pass
  1363.                        * this number as ti_Data to all your windows.
  1364.                        * See also the HelpControl() function.
  1365.                        *)
  1366.  
  1367.   waHelpGroupWindow  * = waDummy + 039H;
  1368.                       (* When the active window has gadget help enabled,
  1369.                        * other windows of the same HelpGroup will also get
  1370.                        * GadgetHelp.  This allows GadgetHelp to work
  1371.                        * for multi-windowed applications.  As an alternative
  1372.                        * to WA_HelpGroup, you can pass a pointer to any
  1373.                        * other window of the same group to join its help
  1374.                        * group.  Defaults to NULL, which has no effect.
  1375.                        * See also the HelpControl() function.
  1376.                        *)
  1377.  
  1378.  
  1379. (* HelpControl() flags:
  1380.  *
  1381.  * HC_GADGETHELP - Set this flag to enable Gadget-Help for one or more
  1382.  * windows.
  1383.  *)
  1384.  
  1385.   hcGadgetHelp * = 1; (* is this flag bit or flag mask? [hG] *)
  1386.  
  1387.  
  1388. TYPE
  1389. (* ======================================================================== *)
  1390. (* === Remember =========================================================== *)
  1391. (* ======================================================================== *)
  1392. (* this structure is used for remembering what memory has been allocated to
  1393.  * date by a given routine, so that a premature abort or systematic exit
  1394.  * can deallocate memory cleanly, easily, and completely
  1395.  *)
  1396.   Remember * = STRUCT
  1397.     nextRemember * : RememberPtr;
  1398.     rememberSize * : LONGINT;
  1399.     memory * : e.APTR;
  1400.   END;
  1401.  
  1402.  
  1403. (* === Color Spec ====================================================== *)
  1404. (* How to tell Intuition about RGB values for a color table entry.
  1405.  * NOTE:  The way the structure was defined, the color value was
  1406.  * right-justified within each UWORD.  This poses problems for
  1407.  * extensibility to more bits-per-gun.        The SA_Colors32 tag to
  1408.  * OpenScreenTags() provides an alternate way to specify colors
  1409.  * with greater precision.
  1410.  *)
  1411.   ColorSpec * = STRUCT
  1412.     colorIndex * : INTEGER;     (* -1 terminates an array of ColorSpec  *)
  1413.     red        * : INTEGER;     (* only _bottom_ 4 bits recognized in V36 *)
  1414.     green      * : INTEGER;     (* only _bottom_ 4 bits recognized in V36 *)
  1415.     blue       * : INTEGER;     (* only _bottom_ 4 bits recognized in V36 *)
  1416.   END;
  1417.  
  1418. (* === Easy Requester Specification ======================================= *)
  1419. (* see also autodocs for EasyRequest and BuildEasyRequest       *)
  1420. (* NOTE: This structure may grow in size in the future          *)
  1421.   EasyStruct * = STRUCT
  1422.     structSize * : LONGINT;     (* should be sizeof (struct EasyStruct )*)
  1423.     flags * : LONGSET;          (* should be 0 for now                  *)
  1424.     title * : e.LSTRPTR;        (* title of requester window            *)
  1425.     textFormat * : e.LSTRPTR;   (* 'printf' style formatting string     *)
  1426.     gadgetFormat * : e.LSTRPTR; (* 'printf' style formatting string   *)
  1427.   END;
  1428.  
  1429.  
  1430. CONST
  1431. (* ======================================================================== *)
  1432. (* === Miscellaneous ====================================================== *)
  1433. (* ======================================================================== *)
  1434.  
  1435. (* = MENU STUFF =========================================================== *)
  1436.   noMenu   * = 0001FU;
  1437.   noItem   * = 0003FU;
  1438.   noSub    * = 0001FU;
  1439.   menuNull * = 0FFFFU;
  1440.  
  1441.  
  1442. (* these defines are for the COMMSEQ and CHECKIT menu stuff.  If CHECKIT,
  1443.  * I'll use a generic Width (for all resolutions) for the CheckMark.
  1444.  * If COMMSEQ, likewise I'll use this generic stuff
  1445.  *)
  1446.   checkWidth     * = 19;
  1447.   commWidth      * = 27;
  1448.   lowCheckWidth  * = 13;
  1449.   lowCommWidth   * = 16;
  1450.  
  1451.  
  1452. (* these are the AlertNumber defines.  if you are calling DisplayAlert()
  1453.  * the AlertNumber you supply must have the ALERT_TYPE bits set to one
  1454.  * of these patterns
  1455.  *)
  1456.   alertType     * = 80000000H;
  1457.   recoveryAlert * = 00000000H;      (* the system can recover from this *)
  1458.   deadendAlert  * = 80000000H;      (* no recovery possible, this is it *)
  1459.  
  1460.  
  1461. (* When you're defining IntuiText for the Positive and Negative Gadgets
  1462.  * created by a call to AutoRequest(), these defines will get you
  1463.  * reasonable-looking text.  The only field without a define is the IText
  1464.  * field; you decide what text goes with the Gadget
  1465.  *)
  1466.   autoFrontPen  * = 0;
  1467.   autoBackPen   * = 1;
  1468.   autoDrawMode  * = g.jam2;
  1469.   autoLeftEdge  * = 6;
  1470.   autoTopEdge   * = 3;
  1471.   autoITextFont * = NIL;
  1472.   autoNextText  * = NIL;
  1473.  
  1474.  
  1475. (* --- RAWMOUSE Codes and Qualifiers (Console OR IDCMP) ------------------- *)
  1476.   selectUp        * = ie.lButton + ie.upPrefix;
  1477.   selectDown      * = ie.lButton;
  1478.   menuUp          * = ie.rButton + ie.upPrefix;
  1479.   menuDown        * = ie.rButton;
  1480.   middleUp        * = ie.mButton + ie.upPrefix;
  1481.   middleDown      * = ie.mButton;
  1482.  
  1483.   altLeft         * = {ie.lAlt};
  1484.   altRight        * = {ie.rAlt};
  1485.   amigaLeft       * = {ie.lCommand};
  1486.   amigaRight      * = {ie.rCommand};
  1487.   amigaKeys       * = amigaLeft + amigaRight;
  1488.  
  1489.   cursorUp        * = 04CH;
  1490.   cursorLeft      * = 04FH;
  1491.   cursorRight     * = 04EH;
  1492.   cursorDown      * = 04DH;
  1493.   keyCodeQ        * = 010H;
  1494.   keyCodeZ        * = 031H;
  1495.   keyCodeX        * = 032H;
  1496.   keyCodeV        * = 034H;
  1497.   keyCodeB        * = 035H;
  1498.   keyCodeN        * = 036H;
  1499.   keyCodeM        * = 037H;
  1500.   keyCodeLess     * = 038H;
  1501.   keyCodeGreater  * = 039H;
  1502.  
  1503. (* New for V39, Intuition supports the IESUBCLASS_NEWTABLET subclass
  1504.  * of the IECLASS_NEWPOINTERPOS event.        The ie_EventAddress of such
  1505.  * an event points to a TabletData structure (see below).
  1506.  *
  1507.  * The TabletData structure contains certain elements including a taglist.
  1508.  * The taglist can be used for special tablet parameters.  A tablet driver
  1509.  * should include only those tag-items the tablet supports.  An application
  1510.  * can listen for any tag-items that interest it.  Note: an application
  1511.  * must set the WA_TabletMessages attribute to TRUE to receive this
  1512.  * extended information in its IntuiMessages.
  1513.  *
  1514.  * The definitions given here MUST be followed.  Pay careful attention
  1515.  * to normalization and the interpretation of signs.
  1516.  *
  1517.  * TABLETA_TabletZ:  the current value of the tablet in the Z direction.
  1518.  * This unsigned value should typically be in the natural units of the
  1519.  * tablet.  You should also provide TABLETA_RangeZ.
  1520.  *
  1521.  * TABLETA_RangeZ:  the maximum value of the tablet in the Z direction.
  1522.  * Normally specified along with TABLETA_TabletZ, this allows the
  1523.  * application to scale the actual Z value across its range.
  1524.  *
  1525.  * TABLETA_AngleX:  the angle of rotation or tilt about the X-axis.  This
  1526.  * number should be normalized to fill a signed long integer.  Positive
  1527.  * values imply a clockwise rotation about the X-axis when viewing
  1528.  * from +X towards the origin.
  1529.  *
  1530.  * TABLETA_AngleY:  the angle of rotation or tilt about the Y-axis.  This
  1531.  * number should be normalized to fill a signed long integer.  Positive
  1532.  * values imply a clockwise rotation about the Y-axis when viewing
  1533.  * from +Y towards the origin.
  1534.  *
  1535.  * TABLETA_AngleZ:  the angle of rotation or tilt about the Z axis.  This
  1536.  * number should be normalized to fill a signed long integer.  Positive
  1537.  * values imply a clockwise rotation about the Z-axis when viewing
  1538.  * from +Z towards the origin.
  1539.  *
  1540.  *    Note: a stylus that supports tilt should use the TABLETA_AngleX
  1541.  *    and TABLETA_AngleY attributes.  Tilting the stylus so the tip
  1542.  *    points towards increasing or decreasing X is actually a rotation
  1543.  *    around the Y-axis.  Thus, if the stylus tip points towards
  1544.  *    positive X, then that tilt is represented as a negative
  1545.  *    TABLETA_AngleY.  Likewise, if the stylus tip points towards
  1546.  *    positive Y, that tilt is represented by positive TABLETA_AngleX.
  1547.  *
  1548.  * TABLETA_Pressure:  the pressure reading of the stylus.  The pressure
  1549.  * should be normalized to fill a signed long integer.        Typical devices
  1550.  * won't generate negative pressure, but the possibility is not precluded.
  1551.  * The pressure threshold which is considered to cause a button-click is
  1552.  * expected to be set in a Preferences program supplied by the tablet
  1553.  * vendor.  The tablet driver would send IECODE_LBUTTON-type events as
  1554.  * the pressure crossed that threshold.
  1555.  *
  1556.  * TABLETA_ButtonBits:        ti_Data is a long integer whose bits are to
  1557.  * be interpreted at the state of the first 32 buttons of the tablet.
  1558.  *
  1559.  * TABLETA_InProximity:  ti_Data is a boolean.        For tablets that support
  1560.  * proximity, they should send the {TABLETA_InProximity,FALSE} tag item
  1561.  * when the stylus is out of proximity.  One possible use we can forsee
  1562.  * is a mouse-blanking commodity which keys off this to blank the
  1563.  * mouse.  When this tag is absent, the stylus is assumed to be
  1564.  * in proximity.
  1565.  *
  1566.  * TABLETA_ResolutionX:  ti_Data is an unsigned long integer which
  1567.  * is the x-axis resolution in dots per inch.
  1568.  *
  1569.  * TABLETA_ResolutionY:  ti_Data is an unsigned long integer which
  1570.  * is the y-axis resolution in dots per inch.
  1571.  *)
  1572.  
  1573.   tabletaDummy       * = u.user + 03A000H;
  1574.   tabletaTabletZ     * = tabletaDummy + 001H;
  1575.   tabletaRangeZ      * = tabletaDummy + 002H;
  1576.   tabletaAngleX      * = tabletaDummy + 003H;
  1577.   tabletaAngleY      * = tabletaDummy + 004H;
  1578.   tabletaAngleZ      * = tabletaDummy + 005H;
  1579.   tabletaPressure    * = tabletaDummy + 006H;
  1580.   tabletaButtonBits  * = tabletaDummy + 007H;
  1581.   tabletaInproximitY * = tabletaDummy + 008H;
  1582.   tabletaResolutionX * = tabletaDummy + 009H;
  1583.   tabletaResolutionY * = tabletaDummy + 00AH;
  1584.  
  1585. (* If your window sets WA_TabletMessages to TRUE, then it will receive
  1586.  * extended IntuiMessages (struct ExtIntuiMessage) whose eim_TabletData
  1587.  * field points at a TabletData structure.  This structure contains
  1588.  * additional information about the input event.
  1589.  *)
  1590.  
  1591. TYPE
  1592.   TabletData * = STRUCT
  1593.     (* Sub-pixel position of tablet, in screen coordinates,
  1594.      * scaled to fill a UWORD fraction:
  1595.      *)
  1596.     xFraction *, yFraction *: INTEGER;
  1597.  
  1598.     (* Current tablet coordinates along each axis: *)
  1599.     tabletX *, tabletY *: LONGINT;
  1600.  
  1601.     (* Tablet range along each axis.  For example, if td_TabletX
  1602.      * can take values 0-999, td_RangeX should be 1000.
  1603.      *)
  1604.     rangeX *, rangeY * : LONGINT;
  1605.  
  1606.     (* Pointer to tag-list of additional tablet attributes.
  1607.      * See <intuition/intuition.h> for the tag values.
  1608.      *)
  1609.     tagList * : u.TagListPtr;
  1610.   END;
  1611.  
  1612. (* If a tablet driver supplies a hook for td_CallBack, it will be
  1613.  * invoked in the standard hook manner.  A0 will point to the Hook
  1614.  * itself, A2 will point to the InputEvent that was sent, and
  1615.  * A1 will point to a TabletHookData structure.  The InputEvent's
  1616.  * ie_EventAddress field points at the IENewTablet structure that
  1617.  * the driver supplied.
  1618.  *
  1619.  * Based on the thd_Screen, thd_Width, and thd_Height fields, the driver
  1620.  * should scale the ient_TabletX and ient_TabletY fields and store the
  1621.  * result in ient_ScaledX, ient_ScaledY, ient_ScaledXFraction, and
  1622.  * ient_ScaledYFraction.
  1623.  *
  1624.  * The tablet hook must currently return NULL.        This is the only
  1625.  * acceptable return-value under V39.
  1626.  *)
  1627.  
  1628.   TabletHookData * = STRUCT
  1629.     (* Pointer to the active screen:
  1630.      * Note: if there are no open screens, thd_Screen will be NULL.
  1631.      * thd_Width and thd_Height will then describe an NTSC 640x400
  1632.      * screen.        Please scale accordingly.
  1633.      *)
  1634.     screen * : ScreenPtr;
  1635.  
  1636.     (* The width and height (measured in pixels of the active screen)
  1637.      * that your are to scale to:
  1638.      *)
  1639.     width  * : LONGINT;
  1640.     height * : LONGINT;
  1641.  
  1642.     (* Non-zero if the screen or something about the screen
  1643.      * changed since the last time you were invoked:
  1644.      *)
  1645.     screenChanged * : LONGINT;
  1646.   END;
  1647.  
  1648.  
  1649. (*
  1650.  * Package of information passed to custom and 'boopsi'
  1651.  * gadget "hook" functions.  This structure is READ ONLY.
  1652.  *)
  1653.   GadgetInfo * = STRUCT
  1654.  
  1655.     screen    - : ScreenPtr;
  1656.     window    - : WindowPtr;           (* null for screen gadgets *)
  1657.     requester - : RequesterPtr;        (* null if not GTYP_REQGADGET *)
  1658.  
  1659.     (* rendering information:
  1660.      * don't use these without cloning/locking.
  1661.      * Official way is to call ObtainRPort()
  1662.      *)
  1663.     rastPort - : g.RastPortPtr;
  1664.     layer    - : g.LayerPtr;
  1665.  
  1666.     (* copy of dimensions of screen/window/g00/req(/group)
  1667.      * that gadget resides in.  Left/Top of this box is
  1668.      * offset from window mouse coordinates to gadget coordinates
  1669.      *          screen gadgets:                 0,0 (from screen coords)
  1670.      *  window gadgets (no g00):        0,0
  1671.      *  GTYP_GZZGADGETs (borderlayer):          0,0
  1672.      *  GZZ innerlayer gadget:          borderleft, bordertop
  1673.      *  Requester gadgets:              reqleft, reqtop
  1674.      *)
  1675.     domain - : IBox;
  1676.  
  1677.     (* these are the pens for the window or screen      *)
  1678.  
  1679.     pens - : STRUCT
  1680.       detailPen - : SHORTINT;
  1681.       blockPen - : SHORTINT;
  1682.     END;
  1683.  
  1684.     (* the Detail and Block pens in gi_DrInfo->dri_Pens[] are
  1685.      * for the screen.  Use the above for window-sensitive
  1686.      * colors.
  1687.      *)
  1688.     drInfo - : DrawInfoPtr;
  1689.  
  1690.     (* reserved space: this structure is extensible
  1691.      * anyway, but using these saves some recompilation
  1692.      *)
  1693.     reserved - : ARRAY 6 OF LONGINT;
  1694.   END;
  1695.  
  1696. (*** system private data structure for now ***)
  1697. (* prop gadget extra info       *)
  1698.   PGX = STRUCT
  1699.     container *: IBox;
  1700.     newKnob   *: IBox;
  1701.   END;
  1702.  
  1703.  
  1704. (*** User visible handles on objects, classes, messages ***)
  1705.   ObjectUsr * = LONGINT;         (* abstract handle *)
  1706.  
  1707.   ClassID   * = e.LSTRPTR;
  1708.  
  1709. (* you can use this type to point to a "generic" message,
  1710.  * in the object-oriented programming parlance.  Based on
  1711.  * the value of 'MethodID', you dispatch to processing
  1712.  * for the various message types.  The meaningful parameter
  1713.  * packet structure definitions are defined below.
  1714.  *)
  1715.   Msg * = STRUCT
  1716.     methodID * : LONGINT;
  1717.     (* method-specific data follows, some examples below *)
  1718.   END;
  1719.  
  1720.  
  1721. CONST
  1722. (*
  1723.  * Class id strings for Intuition classes.
  1724.  * There's no real reason to use the uppercase constants
  1725.  * over the lowercase strings, but this makes a good place
  1726.  * to list the names of the built-in classes.
  1727.  *)
  1728.   rootClass       * = "rootclass";             (* classusr.h   *)
  1729.   imageClass      * = "imageclass";            (* imageclass.h *)
  1730.   frameIClass     * = "frameiclass";
  1731.   sysIClass       * = "sysiclass";
  1732.   fillRectClass   * = "fillrectclass";
  1733.   gadgetClass     * = "gadgetclass";           (* gadgetclass.h *)
  1734.   propGClass      * = "propgclass";
  1735.   strGClass       * = "strgclass";
  1736.   buttonGClass    * = "buttongclass";
  1737.   frButtonClass   * = "frbuttonclass";
  1738.   groupGClass     * = "groupgclass";
  1739.   icClass         * = "icclass";               (* icclass.h    *)
  1740.   modelClass      * = "modelclass";
  1741.   itextIClass     * = "itexticlass";
  1742.   pointerClass    * = "pointerclass";          (* pointerclass.h *)
  1743.  
  1744.  
  1745. (* Dispatched method ID's
  1746.  * NOTE: Applications should use Intuition entry points, not direct
  1747.  * DoMethod() calls, for NewObject, DisposeObject, SetAttrs,
  1748.  * SetGadgetAttrs, and GetAttr.
  1749.  *)
  1750.  
  1751.   dummy        * = 0100H;
  1752.   new          * = 0101H; (* 'object' parameter is "true class"   *)
  1753.   dispose      * = 0102H; (* delete self (no parameters)          *)
  1754.   set          * = 0103H; (* set attributes (in tag list)         *)
  1755.   get          * = 0104H; (* return single attribute value        *)
  1756.   addTail      * = 0105H; (* add self to a List (let root do it)  *)
  1757.   remove       * = 0106H; (* remove self from list                *)
  1758.   notify       * = 0107H; (* send to self: notify dependents      *)
  1759.   update       * = 0108H; (* notification message from somebody   *)
  1760.   addMember    * = 0109H; (* used by various classes with lists   *)
  1761.   remMember    * = 010AH; (* used by various classes with lists   *)
  1762.  
  1763. (* Parameter "Messages" passed to methods       *)
  1764.  
  1765. TYPE
  1766.  
  1767. (* OM_NEW and OM_SET    *)
  1768.   OpSet * = STRUCT (msg * : Msg)
  1769.     attrList * : u.TagListPtr;  (* new attributes       *)
  1770.     gInfo * : GadgetInfoPtr;    (* always there for gadgets,
  1771.                                  * when SetGadgetAttrs() is used,
  1772.                                  * but will be NULL for OM_NEW
  1773.                                  *)
  1774.   END;
  1775.  
  1776. (* OM_NOTIFY, and OM_UPDATE     *)
  1777.   OpUpdate * = STRUCT (msg * : Msg)
  1778.     attrList * : u.TagListPtr;  (* new attributes       *)
  1779.     gInfo * : GadgetInfoPtr;    (* non-NULL when SetGadgetAttrs or
  1780.                                  * notification resulting from gadget
  1781.                                  * input occurs.
  1782.                                  *)
  1783.     flags * : LONGSET;      (* defined below        *)
  1784.   END;
  1785.  
  1786. CONST
  1787.  
  1788. (* this flag means that the update message is being issued from
  1789.  * something like an active gadget, a la GACT_FOLLOWMOUSE.  When
  1790.  * the gadget goes inactive, it will issue a final update
  1791.  * message with this bit cleared.  Examples of use are for
  1792.  * GACT_FOLLOWMOUSE equivalents for propgadclass, and repeat strobes
  1793.  * for buttons.
  1794.  *)
  1795.   interim * = 0;
  1796.  
  1797. TYPE
  1798.  
  1799. (* OM_GET       *)
  1800.   OpGet * = STRUCT (msg * : Msg)
  1801.     attrID  * : LONGINT;
  1802.     storage * : UNTRACED POINTER TO e.ADDRESS;   (* may be other types, but "int"
  1803.                                                   * types are all ULONG
  1804.                                                   *)
  1805.   END;
  1806.  
  1807. (* OM_ADDTAIL   *)
  1808.   OpAddTail * = STRUCT (msg * : Msg)
  1809.     list * : e.ListPtr;
  1810.   END;
  1811.  
  1812. (* OM_ADDMEMBER, OM_REMMEMBER   *)
  1813.   OpMember * = STRUCT (msg * : Msg)
  1814.     object * : ObjectPtr;
  1815.   END;
  1816.  
  1817.  
  1818. (*******************************************)
  1819. (*** "White box" access to struct IClass ***)
  1820. (*******************************************)
  1821.  
  1822. (* This structure is READ-ONLY, and allocated only by Intuition *)
  1823.   IClass * = STRUCT (dispatcher - : u.Hook)
  1824.     reserved - : LONGINT;            (* must be 0  *)
  1825.     super    - : IClassPtr;
  1826.     id       - : ClassID;
  1827.  
  1828.     (* where within an object is the instance data for this class? *)
  1829.     instOffset - : INTEGER;
  1830.     instSize   - : INTEGER;
  1831.  
  1832.     userData      * : LONGINT; (* per-class data of your choice *)
  1833.     subclassCount - : LONGINT; (* how many direct subclasses?  *)
  1834.     objectCount   - : LONGINT; (* how many objects created of this class? *)
  1835.     flags         - : LONGSET;
  1836.   END;
  1837.  
  1838. CONST
  1839.   inList * = 0;        (* class is in public class list *)
  1840.  
  1841. TYPE
  1842.  
  1843. (**************************************************)
  1844. (*** "White box" access to struct _Object       ***)
  1845. (**************************************************)
  1846.  
  1847. (*
  1848.  * We have this, the instance data of the root class, PRECEDING
  1849.  * the "object".  This is so that Gadget objects are Gadget pointers,
  1850.  * and so on.  If this structure grows, it will always have o_Class
  1851.  * at the end, so the macro OCLASS(o) will always have the same
  1852.  * offset back from the pointer returned from NewObject().
  1853.  *
  1854.  * This data structure is subject to change.  Do not use the o_Node
  1855.  * embedded structure.
  1856.  *)
  1857.   Object * = STRUCT (node * : e.MinNode)
  1858.     class * : IClassPtr;
  1859.   END;
  1860.  
  1861. CONST
  1862.  
  1863. (* Gadget Class attributes      *)
  1864.  
  1865.   gaDummy             * = u.user + 30000H;
  1866.   gaLeft              * = gaDummy + 0001H;
  1867.   gaRelRight          * = gaDummy + 0002H;
  1868.   gaTop               * = gaDummy + 0003H;
  1869.   gaRelBottom         * = gaDummy + 0004H;
  1870.   gaWidth             * = gaDummy + 0005H;
  1871.   gaRelWidth          * = gaDummy + 0006H;
  1872.   gaHeight            * = gaDummy + 0007H;
  1873.   gaRelHeight         * = gaDummy + 0008H;
  1874.   gaText              * = gaDummy + 0009H; (* ti_Data is e.LSTRPTR *)
  1875.   gaImage             * = gaDummy + 000AH;
  1876.   gaBorder            * = gaDummy + 000BH;
  1877.   gaSelectRender      * = gaDummy + 000CH;
  1878.   gaHighlight         * = gaDummy + 000DH;
  1879.   gaDisabled          * = gaDummy + 000EH;
  1880.   gaGZZGadget         * = gaDummy + 000FH;
  1881.   gaID                * = gaDummy + 0010H;
  1882.   gaUserData          * = gaDummy + 0011H;
  1883.   gaSpecialInfo       * = gaDummy + 0012H;
  1884.   gaSelected          * = gaDummy + 0013H;
  1885.   gaEndGadget         * = gaDummy + 0014H;
  1886.   gaImmediate         * = gaDummy + 0015H;
  1887.   gaRelVerify         * = gaDummy + 0016H;
  1888.   gaFollowMouse       * = gaDummy + 0017H;
  1889.   gaRightBorder       * = gaDummy + 0018H;
  1890.   gaLeftBorder        * = gaDummy + 0019H;
  1891.   gaTopBorder         * = gaDummy + 001AH;
  1892.   gaBottomBorder      * = gaDummy + 001BH;
  1893.   gaToggleSelect      * = gaDummy + 001CH;
  1894.  
  1895.     (* internal use only, until further notice, please *)
  1896.   gaSysGadget         * = gaDummy + 001DH;
  1897.         (* bool, sets GTYP_SYSGADGET field in type      *)
  1898.   gaSysGType          * = gaDummy + 001EH;
  1899.         (* e.g., GTYP_WUPFRONT, ...     *)
  1900.  
  1901.   gaPrevious          * = gaDummy + 001FH;
  1902.         (* previous gadget (or (struct Gadget ** )) in linked list
  1903.          * NOTE: This attribute CANNOT be used to link new gadgets
  1904.          * into the gadget list of an open window or requester.
  1905.          * You must use AddGList().
  1906.          *)
  1907.  
  1908.   gaNext              * = gaDummy + 0020H;
  1909.          (* not implemented *)
  1910.  
  1911.   gaDrawInfo          * = gaDummy + 0021H;
  1912.         (* some fancy gadgets need to see a DrawInfo
  1913.          * when created or for layout
  1914.          *)
  1915.  
  1916. (* You should use at most ONE of gaText, gaIntuiText, and gaLabelImage *)
  1917.   gaIntuiText         * = gaDummy + 0022H;
  1918.         (* ti_Data is (struct IntuiText * ) *)
  1919.  
  1920.   gaLabelImage        * = gaDummy + 0023H;
  1921.         (* ti_Data is an image (object), used in place of
  1922.          * GadgetText
  1923.          *)
  1924.  
  1925.   gaTabCycle          * = gaDummy + 0024H;
  1926.        (* New for V37:
  1927.         * Boolean indicates that this gadget is to participate in
  1928.         * cycling activation with Tab or Shift-Tab.
  1929.         *)
  1930.  
  1931.   gaGadgetHelp       * = gaDummy + 00025H;
  1932.       (* New for V39:
  1933.        * Boolean indicates that this gadget sends gadget-help
  1934.        *)
  1935.  
  1936.   gaBounds           * = gaDummy + 00026H;
  1937.       (* New for V39:
  1938.        * ti_Data is a pointer to an IBox structure which is
  1939.        * to be copied into the extended gadget's bounds.
  1940.        *)
  1941.  
  1942.   gaRelSpecial       * = gaDummy + 00027H;
  1943.       (* New for V39:
  1944.        * Boolean indicates that this gadget has the "special relativity"
  1945.        * property, which is useful for certain fancy relativity
  1946.        * operations through the GM_LAYOUT method.
  1947.        *)
  1948.  
  1949.  
  1950.  
  1951. (* PROPGCLASS attributes *)
  1952.  
  1953.   pgaDummy       * = u.user  + 31000H;
  1954.   pgaFreedom     * = pgaDummy + 0001H;
  1955.   (* only one of FREEVERT or FREEHORIZ *)
  1956.   pgaBorderless  * = pgaDummy + 0002H;
  1957.   pgaHorizPot    * = pgaDummy + 0003H;
  1958.   pgaHorizBody   * = pgaDummy + 0004H;
  1959.   pgaVertPot     * = pgaDummy + 0005H;
  1960.   pgaVertBody    * = pgaDummy + 0006H;
  1961.   pgaTotal       * = pgaDummy + 0007H;
  1962.   pgaVisible     * = pgaDummy + 0008H;
  1963.   pgaTop         * = pgaDummy + 0009H;
  1964.   pgaNewLook     * = pgaDummy + 000AH;
  1965.  
  1966. (* STRGCLASS attributes *)
  1967.  
  1968.   stringaDummy           * = u.user + 32000H;
  1969.   stringaMaxChars        * = stringaDummy + 0001H;
  1970.  
  1971. (* Note:  There is a minor problem with Intuition when using boopsi integer
  1972.  * gadgets (which are requested by using STRINGA_LongInt).  Such gadgets
  1973.  * must not have a STRINGA_MaxChars to be bigger than 15.  Setting
  1974.  * STRINGA_MaxChars for a boopsi integer gadget will cause a mismatched
  1975.  * FreeMem() to occur.
  1976.  *)
  1977.  
  1978.   stringaBuffer          * = stringaDummy + 0002H;
  1979.   stringaUndoBuffer      * = stringaDummy + 0003H;
  1980.   stringaWorkBuffer      * = stringaDummy + 0004H;
  1981.   stringaBufferPos       * = stringaDummy + 0005H;
  1982.   stringaDispPos         * = stringaDummy + 0006H;
  1983.   stringaAltKeyMap       * = stringaDummy + 0007H;
  1984.   stringaFont            * = stringaDummy + 0008H;
  1985.   stringaPens            * = stringaDummy + 0009H;
  1986.   stringaActivePens      * = stringaDummy + 000AH;
  1987.   stringaEditHook        * = stringaDummy + 000BH;
  1988.   stringaEditModes       * = stringaDummy + 000CH;
  1989.  
  1990. (* booleans *)
  1991.   stringaReplaceMode     * = stringaDummy + 000DH;
  1992.   stringaFixedFieldMode  * = stringaDummy + 000EH;
  1993.   stringaNoFilterMode    * = stringaDummy + 000FH;
  1994.  
  1995.   stringaJustification   * = stringaDummy + 0010H;
  1996.   (* GACT_STRINGCENTER, GACT_STRINGLEFT, GACT_STRINGRIGHT *)
  1997.   stringaLongVal         * = stringaDummy + 0011H;
  1998.   stringaTextVal         * = stringaDummy + 0012H;
  1999.  
  2000.   stringaExitHelp        * = stringaDummy + 0013H;
  2001.         (* STRINGA_ExitHelp is new for V37, and ignored by V36.
  2002.          * Set this if you want the gadget to exit when Help is
  2003.          * pressed.  Look for a code of 0x5F, the rawkey code for Help
  2004.          *)
  2005.  
  2006.   sgDefaultMaxChars      * = 128;
  2007.  
  2008. (* Gadget Layout related attributes     *)
  2009.  
  2010.   layoutaDummy           * = u.user + 38000H;
  2011.   layoutaLayoutObj       * = layoutaDummy + 0001H;
  2012.   layoutaSpacing         * = layoutaDummy + 0002H;
  2013.   layoutaOrientation     * = layoutaDummy + 0003H;
  2014.  
  2015. (* orientation values   *)
  2016.   lorientNone   * = 0;
  2017.   lorientHoriz  * = 1;
  2018.   lorientVert   * = 2;
  2019.  
  2020.  
  2021. (* Gadget Method ID's   *)
  2022.  
  2023.   gmDummy       * = -1;    (* not used for anything                   *)
  2024.   gmHitTest     * =  0;    (* return GMR_GADGETHIT if you are clicked on
  2025.                             * (whether or not you are disabled).
  2026.                             *)
  2027.   gmRender      * = 1;     (* draw yourself, in the appropriate state *)
  2028.   gmGoActive    * = 2;     (* you are now going to be fed input    *)
  2029.   gmHandleInput * = 3;     (* handle that input                    *)
  2030.   gmGoInactive  * = 4;     (* whether or not by choice, you are done  *)
  2031.   gmHelpTest    * = 5;     (* Will you send gadget help if the mouse is
  2032.                             * at the specified coordinates?  See below
  2033.                             * for possible GMR_ values.
  2034.                             *)
  2035.   gmLayout      * = 6;     (* re-evaluate your size based on the GadgetInfo
  2036.                             * Domain.  Do NOT re-render yourself yet, you
  2037.                             * will be called when it is time...
  2038.                             *)
  2039.  
  2040. TYPE
  2041.  
  2042. (* Parameter "Messages" passed to gadget class methods  *)
  2043.  
  2044. (* GM_HITTEST and GM_HELPTEST send this message.
  2045.  * For GM_HITTEST, gpht_Mouse are coordinates relative to the gadget
  2046.  * select box.        For GM_HELPTEST, the coordinates are relative to
  2047.  * the gadget bounding box (which defaults to the select box).
  2048.  *)
  2049. (* GM_HITTEST   *)
  2050.   HitTest * = STRUCT (msg * : Msg)
  2051.     gInfo * : GadgetInfoPtr;
  2052.     mouse * : g.Point;
  2053.   END;
  2054.  
  2055.  
  2056. CONST
  2057.  (* For GM_HITTEST, return GMR_GADGETHIT if you were indeed hit,
  2058.  * otherwise return zero.
  2059.  *
  2060.  * For GM_HELPTEST, return GMR_NOHELPHIT (zero) if you were not hit.
  2061.  * Typically, return GMR_HELPHIT if you were hit.
  2062.  * It is possible to pass a UWORD to the application via the Code field
  2063.  * of the IDCMP_GADGETHELP message.  Return GMR_HELPCODE or'd with
  2064.  * the UWORD-sized result you wish to return.
  2065.  *
  2066.  * GMR_HELPHIT yields a Code value of ((UWORD) ~0), which should
  2067.  * mean "nothing particular" to the application.
  2068.  *)
  2069.  
  2070.   gadgetHit   * = 000000004;    (* GM_HITTEST hit *)
  2071.  
  2072.   noHelpHit   * = 000000000H;   (* GM_HELPTEST didn't hit *)
  2073.   helpHit     * = 0FFFFFFFFH;   (* GM_HELPTEST hit, return code = ~0 *)
  2074.   helpCode    * = 000010000H;   (* GM_HELPTEST hit, return low word as code *)
  2075.  
  2076.  
  2077. TYPE
  2078.  
  2079. (* GM_RENDER    *)
  2080.   Render * = STRUCT (msg * : Msg)
  2081.     gInfo * : GadgetInfoPtr;     (* gadget context               *)
  2082.     rPort * : g.RastPortPtr;     (* all ready for use            *)
  2083.     redraw * : LONGINT;          (* might be a "highlight pass"  *)
  2084.   END;
  2085.  
  2086. CONST
  2087.  
  2088. (* values of gpr_Redraw *)
  2089.   gRedrawUpdate * = 2;    (* incremental update, e.g. prop slider *)
  2090.   gRedrawRedraw * = 1;    (* redraw gadget        *)
  2091.   gRedrawToggle * = 0;    (* toggle highlight, if applicable      *)
  2092.  
  2093. TYPE
  2094.  
  2095. (* GM_GOACTIVE, GM_HANDLEINPUT  *)
  2096.   Input * = STRUCT (msg * : Msg)
  2097.     gInfo * : GadgetInfoPtr;
  2098.     iEvent * : ie.InputEventDummyPtr;
  2099.     termination * : e.APTR;
  2100.     mouse * : g.Point;
  2101.  
  2102.     (* (V39) Pointer to TabletData structure, if this event originated
  2103.      * from a tablet which sends IESUBCLASS_NEWTABLET events, or NULL if
  2104.      * not.
  2105.      *
  2106.      * DO NOT ATTEMPT TO READ THIS FIELD UNDER INTUITION PRIOR TO V39!
  2107.      * IT WILL BE INVALID!
  2108.      *)
  2109.     tabletData * : TabletDataPtr;
  2110.   END;
  2111.  
  2112. CONST
  2113.  
  2114. (* GM_HANDLEINPUT and GM_GOACTIVE  return code flags    *)
  2115. (* return GMR_MEACTIVE (0) alone if you want more input.
  2116.  * Otherwise, return ONE of GMR_NOREUSE and GMR_REUSE, and optionally
  2117.  * GMR_VERIFY.
  2118.  *)
  2119.   gmrMeActive    * = 0;
  2120.   gmrNoReuse     * = 2;
  2121.   gmrReuse       * = 4;
  2122.   gmrVerify      * = 8;       (* you MUST set gpi_Termination *)
  2123.  
  2124.  
  2125. (* New for V37:
  2126.  * You can end activation with one of GMR_NEXTACTIVE and GMR_PREVACTIVE,
  2127.  * which instructs Intuition to activate the next or previous gadget
  2128.  * that has GFLG_TABCYCLE set.
  2129.  *)
  2130.   gmrNextActive  * = 16;
  2131.   gmrPrevActive  * = 32;
  2132.  
  2133. TYPE
  2134.  
  2135.   GoInactive * = STRUCT (msg * : Msg)
  2136.     gInfo * : GadgetInfoPtr;
  2137.     (* V37 field only!        DO NOT attempt to read under V36! *)
  2138.     abort * : LONGINT;                (* gpgi_Abort=1 if gadget was aborted
  2139.                                        * by Intuition and 0 if gadget went
  2140.                                        * inactive at its own request
  2141.                                        *)
  2142.   END;
  2143.  
  2144. (* New for V39: Intuition sends GM_LAYOUT to any GREL_ gadget when
  2145.  * the gadget is added to the window (or when the window opens, if
  2146.  * the gadget was part of the NewWindow.FirstGadget or the WA_Gadgets
  2147.  * list), or when the window is resized.  Your gadget can set the
  2148.  * GA_RelSpecial property to get GM_LAYOUT events without Intuition
  2149.  * changing the interpretation of your gadget select box.  This
  2150.  * allows for completely arbitrary resizing/repositioning based on
  2151.  * window size.
  2152.  *)
  2153. (* GM_LAYOUT *)
  2154.   Layout * = STRUCT (msg * : Msg)
  2155.     gInfo * : GadgetInfoPtr;
  2156.     initial *: LONGINT;    (* non-zero if this method was invoked
  2157.                             * during AddGList() or OpenWindow()
  2158.                             * time.  zero if this method was invoked
  2159.                             * during window resizing.
  2160.                             *)
  2161.   END;
  2162.  
  2163.  
  2164. CONST
  2165.  (* ICClass: *)
  2166.  
  2167.   icmDummy       * = 00401H;       (* used for nothing             *)
  2168.   icmSetLoop     * = 00402H;       (* set/increment loop counter   *)
  2169.   icmClearLoop   * = 00403H;       (* clear/decrement loop counter *)
  2170.   icmCheckLoop   * = 00404H;       (* set/increment loop           *)
  2171.  
  2172. (* no parameters for ICM_SETLOOP, ICM_CLEARLOOP, ICM_CHECKLOOP  *)
  2173.  
  2174. (* interconnection attributes used by icclass, modelclass, and gadgetclass *)
  2175.   icaDummy       * = u.user + 040000H;
  2176.   icaTarget      * = icaDummy + 1;
  2177.   (* interconnection target               *)
  2178.   icaMap         * = icaDummy + 2;
  2179.   (* interconnection map tagitem list     *)
  2180.   icSpecialCode  * = icaDummy + 3;
  2181.   (* a "pseudo-attribute", see below.     *)
  2182.  
  2183. (* Normally, the value for ICA_TARGET is some object pointer,
  2184.  * but if you specify the special value ICTARGET_IDCMP, notification
  2185.  * will be send as an IDCMP_IDCMPUPDATE message to the appropriate window's
  2186.  * IDCMP port.  See the definition of IDCMP_IDCMPUPDATE.
  2187.  *
  2188.  * When you specify ICTARGET_IDCMP for ICA_TARGET, the map you
  2189.  * specify will be applied to derive the attribute list that is
  2190.  * sent with the IDCMP_IDCMPUPDATE message.  If you specify a map list
  2191.  * which results in the attribute tag id ICSPECIAL_CODE, the
  2192.  * lower sixteen bits of the corresponding ti_Data value will
  2193.  * be copied into the Code field of the IDCMP_IDCMPUPDATE IntuiMessage.
  2194.  *)
  2195.   icTargetIDCMP * = -LONGSET{};
  2196.  
  2197.  
  2198. (* ImageClass: *)
  2199.  
  2200.   customImageDepth * = -1;
  2201. (* if image.depth is this, it's a new Image class object *)
  2202.  
  2203. (******************************************************)
  2204.   iaDummy                * = u.user + 20000H;
  2205.   iaLeft                 * = iaDummy + 001H;
  2206.   iaTop                  * = iaDummy + 002H;
  2207.   iaWidth                * = iaDummy + 003H;
  2208.   iaHeight               * = iaDummy + 004H;
  2209.   iaFGPen                * = iaDummy + 005H;
  2210.               (* iaFGPen also means "PlanePick"  *)
  2211.   iaBGPen                * = iaDummy + 006H;
  2212.               (* iaBGPen also means "PlaneOnOff" *)
  2213.   iaData                 * = iaDummy + 007H;
  2214.               (* bitplanes, for classic image,
  2215.                * other image classes may use it for other things
  2216.                *)
  2217.   iaLineWidth            * = iaDummy + 008H;
  2218.   iaPens                 * = iaDummy + 00EH;
  2219.               (* pointer to UWORD pens[],
  2220.                * ala DrawInfo.Pens, MUST be
  2221.                * terminated by ~0.  Some classes can
  2222.                * choose to have this, or SYSiaDrawInfo,
  2223.                * or both.
  2224.                *)
  2225.   iaResolution           * = iaDummy + 00FH;
  2226.               (* packed uwords for x/y resolution into a longword
  2227.                * ala DrawInfo.Resolution
  2228.                *)
  2229.  
  2230. (**** see class documentation to learn which    *****)
  2231. (**** classes recognize these                   *****)
  2232.   iaAPattern             * = iaDummy + 010H;
  2233.   iaAPatSize             * = iaDummy + 011H;
  2234.   iaMode                 * = iaDummy + 012H;
  2235.   iaFont                 * = iaDummy + 013H;
  2236.   iaOutline              * = iaDummy + 014H;
  2237.   iaRecessed             * = iaDummy + 015H;
  2238.   iaDoubleEmboss         * = iaDummy + 016H;
  2239.   iaEdgesOnly            * = iaDummy + 017H;
  2240.  
  2241. (**** "sysiclass" attributes                    *****)
  2242.   sysiaSize              * = iaDummy + 00BH;
  2243.               (* # define's below          *)
  2244.   sysiaDepth             * = iaDummy + 00CH;
  2245.               (* this is unused by Intuition.  sysiaDrawInfo
  2246.                * is used instead for V36
  2247.                *)
  2248.   sysiaWhich             * = iaDummy + 00DH;
  2249.               (* see # define's below      *)
  2250.   sysiaDrawInfo          * = iaDummy + 018H;
  2251.               (* pass to sysiclass, please *)
  2252.  
  2253. (*****  obsolete: don't use these, use iaPens  *****)
  2254.   sysiaPens              * = iaPens;
  2255.   iaShadowPen            * = iaDummy + 009H;
  2256.   iaHighlightPen         * = iaDummy + 00AH;
  2257.  
  2258. (* New for V39: *)
  2259.   sysiaReferenceFont     * = iaDummy + 019H;
  2260.                   (* Font to use as reference for scaling
  2261.                    * certain sysiclass images
  2262.                    *)
  2263.   iaSupportsDisable      * = iaDummy + 01AH;
  2264.                   (* By default, Intuition ghosts gadgets itself,
  2265.                    * instead of relying on IDS_DISABLED or
  2266.                    * IDS_SELECTEDDISABLED.  An imageclass that
  2267.                    * supports these states should return this attribute
  2268.                    * as TRUE.  You cannot set or clear this attribute,
  2269.                    * however.
  2270.                    *)
  2271.  
  2272.   iaFrameType            * = iaDummy + 01BH;
  2273.                   (* Starting with V39, FrameIClass recognizes
  2274.                    * several standard types of frame.  Use one
  2275.                    * of the FRAME_ specifiers below.  Defaults
  2276.                    * to FRAME_DEFAULT.
  2277.                    *)
  2278.  
  2279. (** next attribute: (iaDummy + 0x1c)   **)
  2280. (*************************************************)
  2281.  
  2282. (* data values for sysiaSize   *)
  2283.   sysIsSizeMedres * = 0;
  2284.   sysIsSizeLowres * = 1;
  2285.   sysIsSizeHires  * = 2;
  2286.  
  2287. (*
  2288.  * sysiaWhich tag data values:
  2289.  * Specifies which system gadget you want an image for.
  2290.  * Some numbers correspond to internal Intuition # defines
  2291.  *)
  2292.   depthImage  * = 000H; (* Window depth gadget image *)
  2293.   zoomImage   * = 001H; (* Window zoom gadget image *)
  2294.   sizeImage   * = 002H; (* Window sizing gadget image *)
  2295.   closeImage  * = 003H; (* Window close gadget image *)
  2296.   sDepthImage * = 005H; (* Screen depth gadget image *)
  2297.   leftImage   * = 00AH; (* Left-arrow gadget image *)
  2298.   upImage     * = 00BH; (* Up-arrow gadget image *)
  2299.   rightImage  * = 00CH; (* Right-arrow gadget image *)
  2300.   downImage   * = 00DH; (* Down-arrow gadget image *)
  2301.   checkImage  * = 00EH; (* GadTools checkbox image *)
  2302.   mxImage     * = 00FH; (* GadTools mutual exclude "button" image *)
  2303. (* New for V39: *)
  2304.   menucheck   * = 010H; (* Menu checkmark image *)
  2305.   amigakey    * = 011H; (* Menu Amiga-key image *)
  2306.  
  2307. (* Data values for IA_FrameType (recognized by FrameIClass)
  2308.  *
  2309.  * FRAME_DEFAULT:  The standard V37-type frame, which has
  2310.  *    thin edges.
  2311.  * FRAME_BUTTON:  Standard button gadget frames, having thicker
  2312.  *    sides and nicely edged corners.
  2313.  * FRAME_RIDGE:  A ridge such as used by standard string gadgets.
  2314.  *    You can recess the ridge to get a groove image.
  2315.  * FRAME_ICONDROPBOX: A broad ridge which is the standard imagery
  2316.  *    for areas in AppWindows where icons may be dropped.
  2317.  *)
  2318.  
  2319.   frameDefault     * =  0;
  2320.   frameButton      * =  1;
  2321.   frameRidge       * =  2;
  2322.   frameIconDropBox * =  3;
  2323.  
  2324.  
  2325. (* image message id's   *)
  2326.   imDraw       * = 0202H;  (* draw yourself, with "state"          *)
  2327.   imHitTest    * = 0203H;  (* return TRUE if click hits image      *)
  2328.   imErase      * = 0204H;  (* erase yourself                       *)
  2329.   imMove       * = 0205H;  (* draw new and erase old, smoothly     *)
  2330.  
  2331.   imDrawFrame  * = 0206H;  (* draw with specified dimensions       *)
  2332.   imFrameBox   * = 0207H;  (* get recommended frame around some box*)
  2333.   imHitFrame   * = 0208H;  (* hittest with dimensions              *)
  2334.   imEraseFrame * = 0209H; (* hittest with dimensions              *)
  2335.  
  2336. (* image draw states or styles, for IM_DRAW *)
  2337. (* Note that they have no bitwise meanings (unfortunately) *)
  2338.   idsNormal           * = 0;
  2339.   idsSelected         * = 1;    (* for selected gadgets     *)
  2340.   idsDisabled         * = 2;    (* for disabled gadgets     *)
  2341.   idsBusy             * = 3;    (* for future functionality *)
  2342.   idsIndeterminate    * = 4;    (* for future functionality *)
  2343.   idsInactiveNormal   * = 5;    (* normal, in inactive window border *)
  2344.   idsInactiveSelected * = 6;    (* selected, in inactive border *)
  2345.   idsInactiveDisabled * = 7;    (* disabled, in inactive border *)
  2346.   idsSelectedDisabled * = 8;    (* disabled and selected    *)
  2347.  
  2348. TYPE
  2349.  
  2350. (* IM_FRAMEBOX  *)
  2351.   FrameBox * = STRUCT (msg * : Msg)
  2352.     contentsBox * : IBoxPtr;       (* input: relative box of contents *)
  2353.     frameBox * : IBoxPtr;          (* output: rel. box of encl frame  *)
  2354.     drInfo * : DrawInfoPtr;
  2355.     frameFlags * : LONGSET;
  2356.   END;
  2357.  
  2358. CONST
  2359.  
  2360.   frameFSpecify * = 0;   (* Make do with the dimensions of FrameBox
  2361.                           * provided.
  2362.                           *)
  2363.  
  2364. TYPE
  2365.   Dimensions * = STRUCT  (* used by the following structs *)
  2366.     width * : INTEGER;
  2367.     height * : INTEGER;
  2368.   END;
  2369.  
  2370. (* IM_DRAW, IM_DRAWFRAME        *)
  2371.   Draw * = STRUCT (msg * : Msg)
  2372.     rPort * : g.RastPortPtr;
  2373.     offset * : g.Point;
  2374.     state * : LONGINT;
  2375.     drInfo * : DrawInfoPtr;
  2376.  
  2377.     (* these parameters only valid for IM_DRAWFRAME *)
  2378.     dimensions * : Dimensions;
  2379.   END;
  2380.  
  2381. (* IM_ERASE, IM_ERASEFRAME      *)
  2382. (* NOTE: This is a subset of impDraw    *)
  2383.   Erase * = STRUCT (msg * : Msg)
  2384.     rPort * : g.RastPortPtr;
  2385.     offset * : g.Point;
  2386.  
  2387.     (* these parameters only valid for IM_ERASEFRAME *)
  2388.     dimensions * : Dimensions;
  2389.   END;
  2390.  
  2391. (* IM_HITTEST, IM_HITFRAME      *)
  2392.   IMHitTest * = STRUCT (msg * : Msg)
  2393.     point * : g.Point;
  2394.  
  2395.     (* these parameters only valid for IM_HITFRAME *)
  2396.     dimensions * : Dimensions;
  2397.   END;
  2398.  
  2399. CONST
  2400.  
  2401. (* ---- pointer class --------------------------------------------- *)
  2402.  
  2403.  
  2404. (* The following tags are recognized at NewObject() time by
  2405.  * pointerclass:
  2406.  *
  2407.  * POINTERA_BitMap (struct BitMap * ) - Pointer to bitmap to
  2408.  *      get pointer imagery from.  Bitplane data need not be
  2409.  *      in chip RAM.
  2410.  * POINTERA_XOffset (LONG) - X-offset of the pointer hotspot.
  2411.  * POINTERA_YOffset (LONG) - Y-offset of the pointer hotspot.
  2412.  * POINTERA_WordWidth (ULONG) - designed width of the pointer in words
  2413.  * POINTERA_XResolution (ULONG) - one of the POINTERXRESN_ flags below
  2414.  * POINTERA_YResolution (ULONG) - one of the POINTERYRESN_ flags below
  2415.  *
  2416.  *)
  2417.  
  2418.   pointeraDummy       * =  u.user + 039000H;
  2419.  
  2420.   pointeraBitMap      * =  pointeraDummy + 001H;
  2421.   pointeraXOffset     * =  pointeraDummy + 002H;
  2422.   pointeraYOffset     * =  pointeraDummy + 003H;
  2423.   pointeraWordWidth   * =  pointeraDummy + 004H;
  2424.   pointeraXResolution * =  pointeraDummy + 005H;
  2425.   pointeraYResolution * =  pointeraDummy + 006H;
  2426.  
  2427. (* These are the choices for the POINTERA_XResolution attribute which
  2428.  * will determine what resolution pixels are used for this pointer.
  2429.  *
  2430.  * POINTERXRESN_DEFAULT (ECS-compatible pointer width)
  2431.  *      = 70 ns if SUPERHIRES-type mode, 140 ns if not
  2432.  *
  2433.  * POINTERXRESN_SCREENRES
  2434.  *      = Same as pixel speed of screen
  2435.  *
  2436.  * POINTERXRESN_LORES (pointer always in lores-like pixels)
  2437.  *      = 140 ns in 15kHz modes, 70 ns in 31kHz modes
  2438.  *
  2439.  * POINTERXRESN_HIRES (pointer always in hires-like pixels)
  2440.  *      = 70 ns in 15kHz modes, 35 ns in 31kHz modes
  2441.  *
  2442.  * POINTERXRESN_140NS (pointer always in 140 ns pixels)
  2443.  *      = 140 ns always
  2444.  *
  2445.  * POINTERXRESN_70NS (pointer always in 70 ns pixels)
  2446.  *      = 70 ns always
  2447.  *
  2448.  * POINTERXRESN_35NS (pointer always in 35 ns pixels)
  2449.  *      = 35 ns always
  2450.  *)
  2451.  
  2452.   pointerXResnDefault   * = 0;
  2453.   pointerXResn140ns     * = 1;
  2454.   pointerXResn70ns      * = 2;
  2455.   pointerXResn35ns      * = 3;
  2456.  
  2457.   pointerXResnScreenRes * = 4;
  2458.   pointerXResnLores     * = 5;
  2459.   pointerXResnHires     * = 6;
  2460.  
  2461. (* These are the choices for the POINTERA_YResolution attribute which
  2462.  * will determine what vertical resolution is used for this pointer.
  2463.  *
  2464.  * POINTERYRESN_DEFAULT
  2465.  *      = In 15 kHz modes, the pointer resolution will be the same
  2466.  *        as a non-interlaced screen.  In 31 kHz modes, the pointer
  2467.  *        will be doubled vertically.  This means there will be about
  2468.  *        200-256 pointer lines per screen.
  2469.  *
  2470.  * POINTERYRESN_HIGH
  2471.  * POINTERYRESN_HIGHASPECT
  2472.  *      = Where the hardware/software supports it, the pointer resolution
  2473.  *        will be high.  This means there will be about 400-480 pointer
  2474.  *        lines per screen.  POINTERYRESN_HIGHASPECT also means that
  2475.  *        when the pointer comes out double-height due to hardware/software
  2476.  *        restrictions, its width would be doubled as well, if possible
  2477.  *        (to preserve aspect).
  2478.  *
  2479.  * POINTERYRESN_SCREENRES
  2480.  * POINTERYRESN_SCREENRESASPECT
  2481.  *      = Will attempt to match the vertical resolution of the pointer
  2482.  *        to the screen's vertical resolution.  POINTERYRESN_SCREENASPECT also
  2483.  *        means that when the pointer comes out double-height due to
  2484.  *        hardware/software restrictions, its width would be doubled as well,
  2485.  *        if possible (to preserve aspect).
  2486.  *
  2487.  *)
  2488.  
  2489.   pointerYResnDefault         * = 0;
  2490.   pointerYResnHigh            * = 2;
  2491.   pointerYResnHighAspect      * = 3;
  2492.   pointerYResnScreenRes       * = 4;
  2493.   pointerYResnScreenResAspect * = 5;
  2494.  
  2495. (* Compatibility note:
  2496.  *
  2497.  * The AA chipset supports variable sprite width and resolution, but
  2498.  * the setting of width and resolution is global for all sprites.
  2499.  * When no other sprites are in use, Intuition controls the sprite
  2500.  * width and sprite resolution for correctness based on pointerclass
  2501.  * attributes specified by the creator of the pointer.  Intuition
  2502.  * controls sprite resolution with the VTAG_DEFSPRITERESN_SET tag
  2503.  * to VideoControl().  Applications can override this on a per-viewport
  2504.  * basis with the VTAG_SPRITERESN_SET tag to VideoControl().
  2505.  *
  2506.  * If an application uses a sprite other than the pointer sprite,
  2507.  * Intuition will automatically regenerate the pointer sprite's image in
  2508.  * a compatible width.  This might involve BitMap scaling of the imagery
  2509.  * you supply.
  2510.  *
  2511.  * If any sprites other than the pointer sprite were obtained with the
  2512.  * old GetSprite() call, Intuition assumes that the owner of those
  2513.  * sprites is unaware of sprite resolution, hence Intuition will set the
  2514.  * default sprite resolution (VTAG_DEFSPRITERESN_SET) to ECS-compatible,
  2515.  * instead of as requested by the various pointerclass attributes.
  2516.  *
  2517.  * No resolution fallback occurs when applications use ExtSprites.
  2518.  * Such applications are expected to use VTAG_SPRITERESN_SET tag if
  2519.  * necessary.
  2520.  *
  2521.  * NB:  Under release V39, only sprite width compatibility is implemented.
  2522.  * Sprite resolution compatibility was added for V40.
  2523.  *)
  2524.  
  2525.  
  2526. (* ======================================================================== *)
  2527. (* === Preferences ======================================================== *)
  2528. (* ======================================================================== *)
  2529.  
  2530. (* these are the definitions for the printer configurations *)
  2531.   filenameSize * = 30;      (* Filename size *)
  2532.   devNameSize  * = 16;      (* Device-name size *)
  2533.  
  2534.   pointerSize * = (1 + 16 + 1) * 2;    (* Size of Pointer data buffer *)
  2535.  
  2536. (* These defines are for the default font size.  These actually describe the
  2537.  * height of the defaults fonts.  The default font type is the topaz
  2538.  * font, which is a fixed width font that can be used in either
  2539.  * eighty-column or sixty-column mode.  The Preferences structure reflects
  2540.  * which is currently selected by the value found in the variable FontSize,
  2541.  * which may have either of the values defined below.  These values actually
  2542.  * are used to select the height of the default font.  By changing the
  2543.  * height, the resolution of the font changes as well.
  2544.  *)
  2545.   topazEighty * = 8;
  2546.   topazSixty * = 9;
  2547.  
  2548. TYPE
  2549.   Filename * = ARRAY filenameSize OF CHAR;
  2550.  
  2551. (* Note:  Starting with V36, and continuing with each new version of
  2552.  * Intuition, an increasing number of fields of struct Preferences
  2553.  * are ignored by SetPrefs().  (Some fields are obeyed only at the
  2554.  * initial SetPrefs(), which comes from the devs:system-configuration
  2555.  * file).  Elements are generally superseded as new hardware or software
  2556.  * features demand more information than fits in struct Preferences.
  2557.  * Parts of struct Preferences must be ignored so that applications
  2558.  * calling GetPrefs(), modifying some other part of struct Preferences,
  2559.  * then calling SetPrefs(), don't end up truncating the extended
  2560.  * data.
  2561.  *
  2562.  * Consult the autodocs for SetPrefs() for further information as
  2563.  * to which fields are not always respected.
  2564.  *)
  2565.  
  2566.   Preferences * = STRUCT
  2567.  
  2568.     (* the default font height *)
  2569.     fontHeight  * : SHORTINT;          (* height for system default font  *)
  2570.  
  2571.     (* constant describing what's hooked up to the port *)
  2572.     printerPort * : SHORTINT;          (* printer port connection         *)
  2573.  
  2574.     (* the baud rate of the port *)
  2575.     baudRate    * : INTEGER;           (* baud rate for the serial port   *)
  2576.  
  2577.     (* various timing rates *)
  2578.     keyRptSpeed * : t.TimeVal;         (* repeat speed for keyboard       *)
  2579.     keyRptDelay * : t.TimeVal;         (* Delay before keys repeat        *)
  2580.     doubleClick * : t.TimeVal;         (* Interval allowed between clicks *)
  2581.  
  2582.     (* Intuition Pointer data *)
  2583.     pointerMatrix * : ARRAY pointerSize OF INTEGER;  (* Definition of pointer sprite    *)
  2584.     xOffset      * : SHORTINT;         (* X-Offset for active 'bit'       *)
  2585.     yOffset      * : SHORTINT;         (* Y-Offset for active 'bit'       *)
  2586.     color17      * : INTEGER;          (***********************************)
  2587.     color18      * : INTEGER;          (* Colours for sprite pointer      *)
  2588.     color19      * : INTEGER;          (***********************************)
  2589.     pointerTicks * : INTEGER;          (* Sensitivity of the pointer      *)
  2590.  
  2591.     (* Workbench Screen colors *)
  2592.     color0 * : INTEGER;                (***********************************)
  2593.     color1 * : INTEGER;                (*  Standard default colours       *)
  2594.     color2 * : INTEGER;                (*   Used in the Workbench         *)
  2595.     color3 * : INTEGER;                (***********************************)
  2596.  
  2597.     (* positioning data for the Intuition View *)
  2598.     viewXOffset  * : SHORTINT;         (* Offset for top lefthand corner  *)
  2599.     viewYOffset  * : SHORTINT;         (* X and Y dimensions              *)
  2600.     viewInitX    * ,
  2601.     viewInitY    * : INTEGER;          (* View initial offset values      *)
  2602.  
  2603.     enableCLI    * : SET;              (* CLI availability switch *)
  2604.  
  2605.     (* printer configurations *)
  2606.     printerType     * : INTEGER;       (* printer type            *)
  2607.     printerFilename * : Filename;      (* file for printer        *)
  2608.  
  2609.     (* print format and quality configurations *)
  2610.     printPitch       * : INTEGER;      (* print pitch                     *)
  2611.     printQuality     * : INTEGER;      (* print quality                   *)
  2612.     printSpacing     * : INTEGER;      (* number of lines per inch        *)
  2613.     printLeftMargin  * : INTEGER;      (* left margin in characters       *)
  2614.     printRightMargin * : INTEGER;      (* right margin in characters      *)
  2615.     printImage       * : INTEGER;      (* positive or negative            *)
  2616.     printAspect      * : INTEGER;      (* horizontal or vertical          *)
  2617.     printShade       * : INTEGER;      (* b&w, half-tone, or color        *)
  2618.     printThreshold   * : INTEGER;      (* darkness ctrl for b/w dumps     *)
  2619.  
  2620.     (* print paper descriptors *)
  2621.     paperSize   * : INTEGER;           (* paper size                      *)
  2622.     paperLength * : INTEGER;           (* paper length in number of lines *)
  2623.     paperType   * : INTEGER;           (* continuous or single sheet      *)
  2624.  
  2625.     (* Serial device settings: These are six nibble-fields in three bytes *)
  2626.     (* (these look a little strange so the defaults will map out to zero) *)
  2627.     serRWBits  * : e.BYTE;              (* upper nibble = (8-number of read bits)   *)
  2628.                                        (* lower nibble = (8-number of write bits)   *)
  2629.     serStopBuf * : e.BYTE;             (* upper nibble = (number of stop bits - 1)  *)
  2630.                                        (* lower nibble = (table value for BufSize)  *)
  2631.     serParShk  * : e.BYTE;             (* upper nibble = (value for Parity setting) *)
  2632.                                        (* lower nibble = (value for Handshake mode) *)
  2633.     laceWB     * : SHORTSET;           (* if workbench is to be interlaced          *)
  2634.  
  2635.     pad        *: ARRAY 12 OF e.UBYTE;
  2636.     prtDevName *: ARRAY devNameSize OF CHAR; (* device used by printer.device
  2637.                                               * (omit the ".device")
  2638.                                               *)
  2639.     defaultPrtUnit * : SHORTINT;       (* default unit opened by printer.device *)
  2640.     defaultSerUnit * : SHORTINT;       (* default serial unit *)
  2641.  
  2642.     rowSizeChange    * : SHORTINT;     (* affect NormalDisplayRows/Columns     *)
  2643.     columnSizeChange * : SHORTINT;
  2644.  
  2645.     printFlags     * : SET;            (* user preference flags *)
  2646.     printMaxWidth  * : INTEGER;        (* max width of printed picture in 10ths/in  *)
  2647.     printMaxHeight * : INTEGER;        (* max height of printed picture in 10ths/in *)
  2648.     printDensity   * : SHORTINT;       (* print density *)
  2649.     printXOffset   * : SHORTINT;       (* offset of printed picture in 10ths/inch *)
  2650.  
  2651.     width   * : INTEGER;               (* override default workbench width  *)
  2652.     height  * : INTEGER;               (* override default workbench height *)
  2653.     depth   * : SHORTINT;              (* override default workbench depth  *)
  2654.  
  2655.     extSize * : SHORTINT;              (* extension information -- do not touch! *)
  2656.                                        (* extension size in blocks of 64 bytes   *)
  2657.   END;
  2658.  
  2659. CONST
  2660.  
  2661. (* Workbench Interlace (use one bit) *)
  2662.   laceWB          * = 0;
  2663.   lwReserved      * = 1;          (* internal use only *)
  2664.  
  2665. (* Enable_CLI   *)
  2666.   screenDrag      * = 14;
  2667.   mouseAccel      * = 15;
  2668.  
  2669. (* PrinterPort *)
  2670.   parallelPrinter * = 00H;
  2671.   serialPrinter   * = 01H;
  2672.  
  2673. (* BaudRate *)
  2674.   baud110      * = 000H;
  2675.   baud300      * = 001H;
  2676.   baud1200     * = 002H;
  2677.   baud2400     * = 003H;
  2678.   baud4800     * = 004H;
  2679.   baud9600     * = 005H;
  2680.   baud19200    * = 006H;
  2681.   baudMidi     * = 007H;
  2682.  
  2683. (* PaperType *)
  2684.   fanfold      * = 000H;
  2685.   single       * = 080H;
  2686.  
  2687. (* PrintPitch *)
  2688.   pica         * = 0000H;
  2689.   elite        * = 0400H;
  2690.   fine         * = 0800H;
  2691.  
  2692. (* PrintQuality *)
  2693.   draft        * = 0000H;
  2694.   letter       * = 0100H;
  2695.  
  2696. (* PrintSpacing *)
  2697.   sixLPI       * = 0000H;
  2698.   eightLPI     * = 0200H;
  2699.  
  2700. (* Print Image *)
  2701.   imagePositive * = 000H;
  2702.   imageNegative * = 001H;
  2703.  
  2704. (* PrintAspect *)
  2705.   aspectHoriz  * = 000H;
  2706.   aspectVert   * = 001H;
  2707.  
  2708. (* PrintShade *)
  2709.   shadeBW        * = 000H;
  2710.   shadeGreyScale * = 001H;
  2711.   shadeColor     * = 002H;
  2712.  
  2713. (* PaperSize (all paper sizes have a zero in the lowest nybble) *)
  2714.   usLetter     * = 000H;
  2715.   usLegal      * = 010H;
  2716.   nTractor     * = 020H;
  2717.   wTractor     * = 030H;
  2718.   custom       * = 040H;
  2719.  
  2720. (* PrinterType *)
  2721.   customName           * = 000H;
  2722.   alphaP101            * = 001H;
  2723.   brother15XL          * = 002H;
  2724.   cbmMps1000           * = 003H;
  2725.   diab630              * = 004H;
  2726.   diabAdvD25           * = 005H;
  2727.   diabC150             * = 006H;
  2728.   epson                * = 007H;
  2729.   epsonJX80            * = 008H;
  2730.   okimate20            * = 009H;
  2731.   qumeLP20             * = 00AH;
  2732. (* new printer entries, 3 October 1985 *)
  2733.   hpLaserjet           * = 00BH;
  2734.   hpLaserjetPlus       * = 00CH;
  2735.  
  2736. (* Serial Input Buffer Sizes *)
  2737.   buf512     * = 000H;
  2738.   buf1024    * = 001H;
  2739.   buf2048    * = 002H;
  2740.   buf4096    * = 003H;
  2741.   buf8000    * = 004H;
  2742.   buf16000   * = 005H;
  2743.  
  2744. (* Serial Bit Masks *)
  2745.   readBits    * = 0F0X; (* for SerRWBits   *)
  2746.   writeBits   * = 00FX;
  2747.  
  2748.   stopBits    * = 0F0X; (* for SerStopBuf  *)
  2749.   bufSizeBits * = 00FX;
  2750.  
  2751.   parityBits  * = 0F0X; (* for SerParShk   *)
  2752.   hShakeBits  * = 00FX;
  2753.  
  2754. (* Serial Parity (upper nibble, after being shifted by
  2755.  * macro SPARNUM() )
  2756.  *)
  2757.   parityNone  * = 0;
  2758.   parityEven  * = 1;
  2759.   parityOdd   * = 2;
  2760.  
  2761. (* Serial Handshake Mode (lower nibble, after masking using
  2762.  * macro SHANKNUM() )
  2763.  *)
  2764.   shakeXon   * = 0;
  2765.   shakeRts   * = 1;
  2766.   shakeNone  * = 2;
  2767.  
  2768. (* new defines for PrintFlags *)
  2769.  
  2770.   correctRed          * = 0;  (* color correct red shades *)
  2771.   correctGreen        * = 1;  (* color correct green shades *)
  2772.   correctBlue         * = 2;  (* color correct blue shades *)
  2773.  
  2774.   centerImage         * = 3;  (* center image on paper *)
  2775.  
  2776.   ignoreDimensions    * = {}; (* ignore max width/height settings *)
  2777.   boundedDimensions   * = 4;  (* use max width/height as boundaries *)
  2778.   absoluteDimensions  * = 5;  (* use max width/height as absolutes *)
  2779.   pixelDimensions     * = 6;  (* use max width/height as prt pixels *)
  2780.   multiplyDimensions  * = 7;  (* use max width/height as multipliers *)
  2781.  
  2782.   integerScaling      * = 8;  (* force integer scaling *)
  2783.  
  2784.   orderedDithering    * = {}; (* ordered dithering *)
  2785.   halftoneDithering   * = 9;  (* halftone dithering *)
  2786.   floydDithering      * = 10; (* Floyd-Steinberg dithering *)
  2787.  
  2788.   antiAlias           * = 11; (* anti-alias image *)
  2789.   greyScale2          * = 12; (* for use with hi-res monitor *)
  2790.  
  2791. (* masks used for checking bits *)
  2792.  
  2793.   correctRGBMask      * = {correctRed,correctGreen,correctBlue};
  2794.   dimensionsMask      * = {boundedDimensions,absoluteDimensions,pixelDimensions,multiplyDimensions};
  2795.   ditheringMask       * = {halftoneDithering,floydDithering};
  2796.  
  2797.  
  2798. (* ======================================================================== *)
  2799. (* === DrawInfo ========================================================= *)
  2800. (* ======================================================================== *)
  2801.  
  2802. (* This is a packet of information for graphics rendering.  It originates
  2803.  * with a Screen, and is gotten using GetScreenDrawInfo( screen );
  2804.  *)
  2805.  
  2806. (* You can use the Intuition version number to tell which fields are
  2807.  * present in this structure.
  2808.  *
  2809.  * DRI_VERSION of 1 corresponds to V37 release.
  2810.  * DRI_VERSION of 2 corresponds to V39, and includes three new pens
  2811.  *    and the dri_CheckMark and dri_AmigaKey fields.
  2812.  *
  2813.  * Note that sometimes applications need to create their own DrawInfo
  2814.  * structures, in which case the DRI_VERSION won't correspond exactly
  2815.  * to the OS version!!!
  2816.  *)
  2817.  
  2818.   driVersion * = 2;
  2819.  
  2820. TYPE
  2821.   DrawInfo * = STRUCT
  2822.     version * : INTEGER;      (* will be  DRI_VERSION                 *)
  2823.     numPens * : INTEGER;      (* guaranteed to be >= 9                *)
  2824.     pens * : DRIPenArrayPtr;  (* pointer to pen array                 *)
  2825.  
  2826.     font * : g.TextFontPtr;   (* screen default font                  *)
  2827.     depth * : INTEGER;        (* (initial) depth of screen bitmap     *)
  2828.  
  2829.     resolution * : g.Point;   (* from DisplayInfo database for initial display mode *)
  2830.  
  2831.     flags * : LONGSET;        (* defined below                *)
  2832. (* New for V39: dri_CheckMark, dri_AmigaKey. *)
  2833.     checkMark * : ImagePtr;   (* pointer to scaled checkmark image
  2834.                                * Will be NULL if DRI_VERSION < 2
  2835.                                *)
  2836.     amigaKey *: ImagePtr;      (* pointer to scaled Amiga-key image
  2837.                                * Will be NULL if DRI_VERSION < 2
  2838.                                *)
  2839.     reserved * : ARRAY 5 OF LONGINT;   (* avoid recompilation ;^)      *)
  2840.   END;
  2841.  
  2842. CONST
  2843.  
  2844.   drifNewLook * = 0;    (* specified SA_Pens, full treatment *)
  2845.  
  2846. (* rendering pen number indexes into DrawInfo.dri_Pens[]        *)
  2847.   detailPen        * = 0000H;       (* compatible Intuition rendering pens  *)
  2848.   blockPen         * = 0001H;       (* compatible Intuition rendering pens  *)
  2849.   textPen          * = 0002H;       (* text on background                   *)
  2850.   shinePen         * = 0003H;       (* bright edge on 3D objects            *)
  2851.   shadowPen        * = 0004H;       (* dark edge on 3D objects              *)
  2852.   fillPen          * = 0005H;       (* active-window/selected-gadget fill   *)
  2853.   fillTextPen      * = 0006H;       (* text over FILLPEN                    *)
  2854.   backGroundPen    * = 0007H;       (* always color 0                       *)
  2855.   highLightTextPen * = 0008H;       (* special color text, on background    *)
  2856.  
  2857. (* New for V39, only present if DRI_VERSION >= 2: *)
  2858.   barDetailPen     * = 00009H;      (* text/detail in screen-bar/menus *)
  2859.   barBlockPen      * = 0000AH;      (* screen-bar/menus fill *)
  2860.   barTrimPen       * = 0000BH;      (* trim under screen-bar *)
  2861.  
  2862.   numDRIPens       * = 000CH;
  2863.  
  2864.  
  2865. (* New for V39:  It is sometimes useful to specify that a pen value
  2866.  * is to be the complement of color zero to three.  The "magic" numbers
  2867.  * serve that purpose:
  2868.  *)
  2869.   penC3 * =  0FEFCH;          (* Complement of color 3 *)
  2870.   penC2 * =  0FEFDH;          (* Complement of color 2 *)
  2871.   penC1 * =  0FEFEH;          (* Complement of color 1 *)
  2872.   penC0 * =  0FEFFH;          (* Complement of color 0 *)
  2873.  
  2874. TYPE
  2875.   DRIPenArray * = ARRAY numDRIPens OF INTEGER; (* you MUST NOT use an index
  2876.                                                 * higher than allowed for
  2877.                                                 * the actual DRI_VERSION
  2878.                                                 *)
  2879.  
  2880. (* ======================================================================== *)
  2881. (* === Screen ============================================================= *)
  2882. (* ======================================================================== *)
  2883.  
  2884. (* VERY IMPORTANT NOTE ABOUT Screen->BitMap.  In the future, bitmaps
  2885.  * will need to grow.  The embedded instance of a bitmap in the screen
  2886.  * will no longer be large enough to hold the whole description of
  2887.  * the bitmap.
  2888.  *
  2889.  * YOU ARE STRONGLY URGED to use Screen->RastPort.BitMap in place of
  2890.  * &Screen->BitMap whenever and whereever possible.
  2891.  *)
  2892.  
  2893.   Screen * = STRUCT
  2894.  
  2895.     nextScreen * : ScreenPtr;           (* linked list of screens *)
  2896.     firstWindow * : WindowPtr;          (* linked list Screen's Windows *)
  2897.  
  2898.     leftEdge * , topEdge * : INTEGER;   (* parameters of the screen *)
  2899.     width * , height * : INTEGER;       (* parameters of the screen *)
  2900.  
  2901.     mouseY * , mouseX * : INTEGER;      (* position relative to upper-left *)
  2902.  
  2903.     flags * : SET;                      (* see definitions below *)
  2904.  
  2905.     title * : e.LSTRPTR;                (* null-terminated Title text *)
  2906.     defaultTitle * : e.LSTRPTR;         (* for Windows without ScreenTitle *)
  2907.  
  2908.     (* Bar sizes for this Screen and all Window's in this Screen *)
  2909.     (* Note that BarHeight is one less than the actual menu bar
  2910.      * height.  We're going to keep this in V36 for compatibility,
  2911.      * although V36 artwork might use that extra pixel
  2912.      *
  2913.      * Also, the title bar height of a window is calculated from the
  2914.      * screen's WBorTop field, plus the font height, plus one.
  2915.      *)
  2916.     barHeight * , barVBorder * , barHBorder * ,
  2917.     menuVBorder * , menuHBorder * : SHORTINT;
  2918.     wBorTop * , wBorLeft * , wBorRight * , wBorBottom * : SHORTINT;
  2919.  
  2920.     font * : g.TextAttrPtr;             (* this screen's default font      *)
  2921.  
  2922.     (* the display data structures for this Screen *)
  2923.     viewPort * : g.ViewPort;            (* describing the Screen's display *)
  2924.     rastPort * : g.RastPort;            (* describing Screen rendering     *)
  2925.     bitMap * : g.BitMap;                (* SEE WARNING ABOVE!              *)
  2926.     layerInfo * : g.LayerInfo;          (* each screen gets a LayerInfo    *)
  2927.  
  2928.     (* Only system gadgets may be attached to a screen.
  2929.      *  You get the standard system Screen Gadgets automatically
  2930.      *)
  2931.     firstGadget * : GadgetDummyPtr;
  2932.  
  2933.     detailPen * , blockPen * : SHORTINT;    (* for bar/border/gadget rendering *)
  2934.  
  2935.     (* the following variable(s) are maintained by Intuition to support the
  2936.      * DisplayBeep() color flashing technique
  2937.      *)
  2938.     saveColor0 * : INTEGER;
  2939.  
  2940.     (* This layer is for the Screen and Menu bars *)
  2941.     barLayer * : g.LayerPtr;
  2942.  
  2943.     extData * : e.APTR;
  2944.  
  2945.     userData * : e.APTR;    (* general-purpose pointer to User data extension *)
  2946.  
  2947.     (**** Data below this point are SYSTEM PRIVATE ****)
  2948.  
  2949.   END;
  2950.  
  2951. CONST
  2952.  
  2953. (* --- FLAGS SET BY INTUITION --------------------------------------------- *)
  2954. (* The SCREENTYPE bits are reserved for describing various Screen types
  2955.  * available under Intuition.
  2956.  *)
  2957.   screenType      * = {0..3};  (* all the screens types available      *)
  2958. (* --- the definitions for the Screen Type ------------------------------- *)
  2959.   wbenchScreen    * = 0;      (* identifies the Workbench screen      *)
  2960.   publicScreen    * = 1;      (* public shared (custom) screen        *)
  2961.   customScreen    * = {0..3}; (* original custom screens              *)
  2962.  
  2963.   showTitle       * = 4;  (* this gets set by a call to ShowTitle() *)
  2964.  
  2965.   beeping           = 5;  (* set when Screen is beeping (private)   *)
  2966.  
  2967.   customBitMap    * = 6;  (* if you are supplying your own BitMap   *)
  2968.  
  2969.   screenBehind    * = 7;  (* if you want your screen to open behind
  2970.                            * already open screens
  2971.                            *)
  2972.   screenQuiet     * = 8;  (* if you do not want Intuition to render
  2973.                            * into your screen (gadgets, title)
  2974.                            *)
  2975.   screenHires       = 9;  (* do not use lowres gadgets  (private) *)
  2976.  
  2977.   nsExtended      * = 12;         (* ExtNewScreen.Extension is valid      *)
  2978. (* V36 applications can use OpenScreenTagList() instead of NS_EXTENDED       *)
  2979.  
  2980.   autoScroll      * = 14; (* screen is to autoscoll               *)
  2981.  
  2982. (* New for V39: *)
  2983.   penshared       * = 10;  (* Screen opener set {SA_SharePens,TRUE} *)
  2984.  
  2985.  
  2986.  
  2987.   stdScreenHeight * = -1; (* supply in NewScreen.height           *)
  2988.   stdScreenWidth  * = -1; (* supply in NewScreen.width            *)
  2989.  
  2990. (*
  2991.  * Screen attribute tag ID's.  These are used in the ti_Tag field of
  2992.  * TagItem arrays passed to OpenScreenTagList() (or in the
  2993.  * ExtNewScreen.Extension field).
  2994.  *)
  2995.  
  2996. (* Screen attribute tags.  Please use these versions, not those in
  2997.  * iobsolete.h.
  2998.  *)
  2999.  
  3000.   saDummy        * = u.user + 32;
  3001. (*
  3002.  * these items specify items equivalent to fields in NewScreen
  3003.  *)
  3004.   saLeft         * = saDummy + 00001H;
  3005.   saTop          * = saDummy + 00002H;
  3006.   saWidth        * = saDummy + 00003H;
  3007.   saHeight       * = saDummy + 00004H; (* traditional screen positions and dimensions  *)
  3008.   saDepth        * = saDummy + 00005H; (* screen bitmap depth                          *)
  3009.   saDetailPen    * = saDummy + 00006H; (* serves as default for windows, too           *)
  3010.   saBlockPen     * = saDummy + 00007H;
  3011.   saTitle        * = saDummy + 00008H; (* default screen title                         *)
  3012.   saColors       * = saDummy + 00009H;
  3013.                   (* ti_Data is an array of struct ColorSpec,
  3014.                    * terminated by ColorIndex = -1.  Specifies
  3015.                    * initial screen palette colors.
  3016.                    * Also see SA_Colors32 for use under V39.
  3017.                    *)
  3018.   saErrorCode    * = saDummy + 0000AH; (* ti_Data points to LONG error code (values below)*)
  3019.   saFont         * = saDummy + 0000BH; (* equiv. to NewScreen.Font                     *)
  3020.   saSysFont      * = saDummy + 0000CH;
  3021.                   (* Selects one of the preferences system fonts:
  3022.                    *      0 - old DefaultFont, fixed-width
  3023.                    *      1 - WB Screen preferred font
  3024.                    *)
  3025.   saType         * = saDummy + 0000DH;
  3026.                   (* ti_Data is PUBLICSCREEN or CUSTOMSCREEN.  For other
  3027.                    * fields of NewScreen.Type, see individual tags,
  3028.                    * eg. SA_Behind, SA_Quiet.
  3029.                    *)
  3030.   saBitMap       * = saDummy + 0000EH;
  3031.                   (* ti_Data is pointer to custom BitMap.  This
  3032.                    * implies type of CUSTOMBITMAP
  3033.                    *)
  3034.   saPubName      * = saDummy + 0000FH;
  3035.                   (* presence of this tag means that the screen
  3036.                    * is to be a public screen.  Please specify
  3037.                    * BEFORE the two tags below
  3038.                    *)
  3039.   saPubSig       * = saDummy + 00010H;
  3040.   saPubTask      * = saDummy + 00011H;
  3041.                   (* Task ID and signal for being notified that
  3042.                    * the last window has closed on a public screen.
  3043.                    *)
  3044.   saDisplayID    * = saDummy + 00012H;
  3045.                   (* ti_Data is new extended display ID from
  3046.                    * <graphics/displayinfo.h> (V37) or from
  3047.                    * <graphics/modeid.h> (V39 and up)
  3048.                    *)
  3049.   saDClip        * = saDummy + 00013H;
  3050.                   (* ti_Data points to a rectangle which defines
  3051.                    * screen display clip region
  3052.                    *)
  3053.   saOverscan     * = saDummy + 00014H;
  3054.                   (* Set to one of the oScan
  3055.                    * specifiers below to get a system standard
  3056.                    * overscan region for your display clip,
  3057.                    * screen dimensions (unless otherwise specified),
  3058.                    * and automatically centered position (partial
  3059.                    * support only so far).
  3060.                    * If you use this, you shouldn't specify
  3061.                    * saDClip.  saOverscan is for "standard"
  3062.                    * overscan dimensions, saDClip is for
  3063.                    * your custom numeric specifications.
  3064.                    *)
  3065.   saObsolete1    * = saDummy + 00015H; (* obsolete S_MONITORNAME *)
  3066.  
  3067. (** booleans **)
  3068.   saShowTitle    * = saDummy + 00016H; (* boolean equivalent to flag SHOWTITLE         *)
  3069.   saBehind       * = saDummy + 00017H; (* boolean equivalent to flag SCREENBEHIND      *)
  3070.   saQuiet        * = saDummy + 00018H; (* boolean equivalent to flag SCREENQUIET       *)
  3071.   saAutoScroll   * = saDummy + 00019H; (* boolean equivalent to flag AUTOSCROLL        *)
  3072.   saPens         * = saDummy + 0001AH;
  3073.                   (* pointer to ~0 terminated UWORD array, as
  3074.                    * found in struct DrawInfo
  3075.                    *)
  3076.   saFullPalette  * = saDummy + 0001BH;
  3077.                   (* boolean: initialize color table to entire
  3078.                    *  preferences palette (32 for V36), rather
  3079.                    * than compatible pens 0-3, 17-19, with
  3080.                    * remaining palette as returned by GetColorMap()
  3081.                    *)
  3082.   saColorMapEntries * = saDummy + 0001CH;
  3083.                       (* New for V39:
  3084.                        * Allows you to override the number of entries
  3085.                        * in the ColorMap for your screen.  Intuition
  3086.                        * normally allocates (1<<depth) or 32, whichever
  3087.                        * is more, but you may require even more if you
  3088.                        * use certain V39 graphics.library features
  3089.                        * (eg. palette-banking).
  3090.                        *)
  3091.  
  3092.   saParent       * = saDummy + 0001DH;
  3093.                       (* New for V39:
  3094.                        * ti_Data is a pointer to a "parent" screen to
  3095.                        * attach this one to.  Attached screens slide
  3096.                        * and depth-arrange together.
  3097.                        *)
  3098.  
  3099.   saDraggable    * = saDummy + 0001EH;
  3100.                       (* New for V39:
  3101.                        * Boolean tag allowing non-draggable screens.
  3102.                        * Do not use without good reason!
  3103.                        * (Defaults to TRUE).
  3104.                        *)
  3105.  
  3106.   saExclusive    * = saDummy + 0001FH;
  3107.                       (* New for V39:
  3108.                        * Boolean tag allowing screens that won't share
  3109.                        * the display.  Use sparingly!  Starting with 3.01,
  3110.                        * attached screens may be SA_Exclusive.  Setting
  3111.                        * SA_Exclusive for each screen will produce an
  3112.                        * exclusive family.   (Defaults to FALSE).
  3113.                        *)
  3114.  
  3115.   saSharePens    * = saDummy + 00020H;
  3116.                       (* New for V39:
  3117.                        * For those pens in the screen's DrawInfo->dri_Pens,
  3118.                        * Intuition obtains them in shared mode (see
  3119.                        * graphics.library/ObtainPen()).  For compatibility,
  3120.                        * Intuition obtains the other pens of a public
  3121.                        * screen as PEN_EXCLUSIVE.  Screens that wish to
  3122.                        * manage the pens themselves should generally set
  3123.                        * this tag to TRUE.  This instructs Intuition to
  3124.                        * leave the other pens unallocated.
  3125.                        *)
  3126.  
  3127.   saBackFill     * = saDummy + 00021H;
  3128.                       (* New for V39:
  3129.                        * provides a "backfill hook" for your screen's
  3130.                        * Layer_Info.
  3131.                        * See layers.library/InstallLayerInfoHook()
  3132.                        *)
  3133.  
  3134.   saInterleaved  * = saDummy + 00022H;
  3135.                       (* New for V39:
  3136.                        * Boolean tag requesting that the bitmap
  3137.                        * allocated for you be interleaved.
  3138.                        * (Defaults to FALSE).
  3139.                        *)
  3140.  
  3141.   saColors32     * = saDummy + 00023H;
  3142.                       (* New for V39:
  3143.                        * Tag to set the screen's initial palette colors
  3144.                        * at 32 bits-per-gun.  ti_Data is a pointer
  3145.                        * to a table to be passed to the
  3146.                        * graphics.library/LoadRGB32() function.
  3147.                        * This format supports both runs of color
  3148.                        * registers and sparse registers.  See the
  3149.                        * autodoc for that function for full details.
  3150.                        * Any color set here has precedence over
  3151.                        * the same register set by SA_Colors.
  3152.                        *)
  3153.  
  3154.   saVideoControl * = saDummy + 00024H;
  3155.                       (* New for V39:
  3156.                        * ti_Data is a pointer to a taglist that Intuition
  3157.                        * will pass to graphics.library/VideoControl(),
  3158.                        * upon opening the screen.
  3159.                        *)
  3160.  
  3161.   saFrontChild   * = saDummy + 00025H;
  3162.                       (* New for V39:
  3163.                        * ti_Data is a pointer to an already open screen
  3164.                        * that is to be the child of the screen being
  3165.                        * opened.  The child screen will be moved to the
  3166.                        * front of its family.
  3167.                        *)
  3168.  
  3169.   saBackChild    * = saDummy + 00026H;
  3170.                       (* New for V39:
  3171.                        * ti_Data is a pointer to an already open screen
  3172.                        * that is to be the child of the screen being
  3173.                        * opened.  The child screen will be moved to the
  3174.                        * back of its family.
  3175.                        *)
  3176.  
  3177.   saLikeWorkbench * = saDummy + 00027H;
  3178.                       (* New for V39:
  3179.                        * Set ti_Data to 1 to request a screen which
  3180.                        * is just like the Workbench.  This gives
  3181.                        * you the same screen mode, depth, size,
  3182.                        * colors, etc., as the Workbench screen.
  3183.                        *)
  3184.  
  3185.   saReserved       = saDummy + 00028H;
  3186.                       (* Reserved for private Intuition use *)
  3187.  
  3188.   saMinimizeISG * =  saDummy + 00029H;
  3189.                         (* New for V40:
  3190.                          * For compatibility, Intuition always ensures
  3191.                          * that the inter-screen gap is at least three
  3192.                          * non-interlaced lines.  If your application
  3193.                          * would look best with the smallest possible
  3194.                          * inter-screen gap, set ti_Data to TRUE.
  3195.                          * If you use the new graphics VideoControl()
  3196.                          * VC_NoColorPaletteLoad tag for your screen's
  3197.                          * ViewPort, you should also set this tag.
  3198.                          *)
  3199.  
  3200.  
  3201. (* OpenScreen error codes, which are returned in the (optional) LONG
  3202.  * pointed to by ti_Data for the saErrorCode tag item
  3203.  *)
  3204.   osErrNoMonitor * = 1;     (* named monitor spec not available     *)
  3205.   osErrNoChips   * = 2;     (* you need newer custom chips          *)
  3206.   osErrNoMem     * = 3;     (* couldn't get normal memory           *)
  3207.   osErrNoChipMem * = 4;     (* couldn't get chipmem                 *)
  3208.   osErrPubNotUnique * = 5;  (* public screen name already used      *)
  3209.   osErrUnknownMode  * = 6;  (* don't recognize mode asked for       *)
  3210.   oserrTooDeep      * = 7;  (* Screen deeper than HW supports       *)
  3211.   oserrAttachFail   * = 8;  (* Failed to attach screens             *)
  3212.   oserrNotAvailable * = 9;  (* Mode not available for other reason  *)
  3213.  
  3214.  
  3215. TYPE
  3216. (* ======================================================================== *)
  3217. (* === NewScreen ========================================================== *)
  3218. (* ======================================================================== *)
  3219. (* note: to use the Extended field, you must use the
  3220.  * new ExtNewScreen structure, below
  3221.  *)
  3222.   NewScreen * = STRUCT
  3223.  
  3224.     leftEdge * , topEdge * , width * , height * , depth * : INTEGER;  (* screen dimensions *)
  3225.  
  3226.     detailPen * , blockPen * : SHORTINT; (* for bar/border/gadget rendering      *)
  3227.  
  3228.     viewModes * : SET;                   (* the Modes for the ViewPort (and View) *)
  3229.  
  3230.     type * : SET;                        (* the Screen type (see defines above)  *)
  3231.  
  3232.     font * : g.TextAttrPtr;              (* this Screen's default text attributes *)
  3233.  
  3234.     defaultTitle * : e.LSTRPTR;          (* the default title for this Screen    *)
  3235.  
  3236.     gadgets * : GadgetDummyPtr;          (* UNUSED:  Leave this NULL             *)
  3237.  
  3238.     (* if you are opening a CUSTOMSCREEN and already have a BitMap
  3239.      * that you want used for your Screen, you set the flags CUSTOMBITMAP in
  3240.      * the Type field and you set this variable to point to your BitMap
  3241.      * structure.  The structure will be copied into your Screen structure,
  3242.      * after which you may discard your own BitMap if you want
  3243.      *)
  3244.     customBitMap * : g.BitMapPtr;
  3245.  
  3246.   END;
  3247.  
  3248. (*
  3249.  * For compatibility reasons, we need a new structure for extending
  3250.  * NewScreen.  Use this structure is you need to use the new Extension
  3251.  * field.
  3252.  *
  3253.  * NOTE: V36-specific applications should use the
  3254.  * OpenScreenTagList( newscreen, tags ) version of OpenScreen().
  3255.  * Applications that want to be V34-compatible as well may safely use the
  3256.  * ExtNewScreen structure.  Its tags will be ignored by V34 Intuition.
  3257.  *
  3258.  *)
  3259.   ExtNewScreen * = STRUCT (ns * : NewScreen)
  3260.  
  3261.     extension * : u.TagListPtr; (* more specification data, scanned if
  3262.                                  * NS_EXTENDED is set in NewScreen.Type
  3263.                                  *)
  3264.   END;
  3265.  
  3266. CONST
  3267.  
  3268. (* === Overscan Types ===       *)
  3269.   oScanText      * = 1;     (* entirely visible     *)
  3270.   oScanStandard  * = 2;     (* just past edges      *)
  3271.   oScanMax       * = 3;     (* as much as possible  *)
  3272.   oScanVideo     * = 4;     (* even more than is possible   *)
  3273.  
  3274.  
  3275. TYPE
  3276.  
  3277. (* === Public Shared Screen Node ===    *)
  3278.  
  3279. (* This is the representative of a public shared screen.
  3280.  * This is an internal data structure, but some functions may
  3281.  * present a copy of it to the calling application.  In that case,
  3282.  * be aware that the screen pointer of the structure can NOT be
  3283.  * used safely, since there is no guarantee that the referenced
  3284.  * screen will remain open and a valid data structure.
  3285.  *
  3286.  * Never change one of these.
  3287.  *)
  3288.  
  3289.   PubScreenNode * = STRUCT (node * : e.Node) (* ln_Name is screen name *)
  3290.     screen * : ScreenPtr;
  3291.     flags * : SET;            (* see below            *)
  3292.     size * : INTEGER;         (* includes name buffer *)
  3293.     visitorCount * : INTEGER; (* how many visitor windows *)
  3294.     sigTask * : e.TaskPtr;    (* who to signal when visitors gone *)
  3295.     sigBit * : SHORTINT;      (* which signal *)
  3296.   END;
  3297.  
  3298. CONST
  3299.   psnfPrivate * = 0;
  3300.  
  3301.   maxPubScreenName * = 139;   (* names no longer, please      *)
  3302.  
  3303. (* pub screen modes     *)
  3304.   shanghai      * = 0;  (* put workbench windows on pub screen *)
  3305.   popPubScreen  * = 1;  (* pop pub screen to front when visitor opens *)
  3306.  
  3307. (* New for V39:  Intuition has new screen depth-arrangement and movement
  3308.  * functions called ScreenDepth() and ScreenPosition() respectively.
  3309.  * These functions permit the old behavior of ScreenToFront(),
  3310.  * ScreenToBack(), and MoveScreen().  ScreenDepth() also allows
  3311.  * independent depth control of attached screens.  ScreenPosition()
  3312.  * optionally allows positioning screens even though they were opened
  3313.  * {SA_Draggable,FALSE}.
  3314.  *)
  3315.  
  3316. (* For ScreenDepth(), specify one of SDEPTH_TOFRONT or SDEPTH_TOBACK,
  3317.  * and optionally also SDEPTH_INFAMILY.
  3318.  *
  3319.  * NOTE: ONLY THE OWNER OF THE SCREEN should ever specify
  3320.  * SDEPTH_INFAMILY.  Commodities, "input helper" programs,
  3321.  * or any other program that did not open a screen should never
  3322.  * use that flag.  (Note that this is a style-behavior
  3323.  * requirement;  there is no technical requirement that the
  3324.  * task calling this function need be the task which opened
  3325.  * the screen).
  3326.  *)
  3327.  
  3328.   sdepthToFront  * = 0;     (* Bring screen to front *)
  3329.   sdepthToBack   * = 1;     (* Send screen to back *)
  3330.   sdepthInFamily * = 2;     (* Move an attached screen with
  3331.                              * respect to other screens of
  3332.                              * its family
  3333.                              *)
  3334.  
  3335. (* Here's an obsolete name equivalent to SDEPTH_INFAMILY: *)
  3336.   sdepthChildOnly * = sdepthInFamily;
  3337.  
  3338.  
  3339. (* For ScreenPosition(), specify one of SPOS_RELATIVE, SPOS_ABSOLUTE,
  3340.  * or SPOS_MAKEVISIBLE to describe the kind of screen positioning you
  3341.  * wish to perform:
  3342.  *
  3343.  * SPOS_RELATIVE: The x1 and y1 parameters to ScreenPosition() describe
  3344.  *    the offset in coordinates you wish to move the screen by.
  3345.  * SPOS_ABSOLUTE: The x1 and y1 parameters to ScreenPosition() describe
  3346.  *    the absolute coordinates you wish to move the screen to.
  3347.  * SPOS_MAKEVISIBLE: (x1,y1)-(x2,y2) describes a rectangle on the
  3348.  *    screen which you would like autoscrolled into view.
  3349.  *
  3350.  * You may additionally set SPOS_FORCEDRAG along with any of the
  3351.  * above.  Set this if you wish to reposition an {SA_Draggable,FALSE}
  3352.  * screen that you opened.
  3353.  *
  3354.  * NOTE: ONLY THE OWNER OF THE SCREEN should ever specify
  3355.  * SPOS_FORCEDRAG.  Commodities, "input helper" programs,
  3356.  * or any other program that did not open a screen should never
  3357.  * use that flag.
  3358.  *)
  3359.  
  3360.   sposRelative   * = LONGSET{};   (* Coordinates are relative *)
  3361.  
  3362.   sposAbsolute   * = LONGSET{0};  (* Coordinates are expressed as
  3363.                                    * absolutes, not relatives.
  3364.                                    *)
  3365.  
  3366.   sposMakeVisible * = LONGSET{1}; (* Coordinates describe a box on
  3367.                                    * the screen you wish to be
  3368.                                    * made visible by autoscrolling
  3369.                                    *)
  3370.  
  3371.   sposForceDrag  * = LONGSET{2};  (* Move non-draggable screen *)
  3372.  
  3373.  
  3374. TYPE
  3375. (* New for V39: Intuition supports double-buffering in screens,
  3376.  * with friendly interaction with menus and certain gadgets.
  3377.  * For each buffer, you need to get one of these structures
  3378.  * from the AllocScreenBuffer() call.  Never allocate your
  3379.  * own ScreenBuffer structures!
  3380.  *
  3381.  * The sb_DBufInfo field is for your use.  See the graphics.library
  3382.  * AllocDBufInfo() autodoc for details.
  3383.  *)
  3384.   ScreenBuffer * = STRUCT
  3385.      bitMap * : g.BitMapPtr;         (* BitMap of this buffer *)
  3386.     dBufInfo *: g.DBufInfoPtr;     (* DBufInfo for this buffer *)
  3387.   END;
  3388.  
  3389. CONST
  3390. (* These are the flags that may be passed to AllocScreenBuffer().
  3391.  *)
  3392.   sbScreenBitMap * = 1;
  3393.   sbCopyBitMap   * = 2;
  3394.  
  3395. TYPE
  3396.  
  3397.   StringExtend * = STRUCT
  3398.     (* display specifications   *)
  3399.     font * : g.TextFontPtr;              (* must be an open Font (not TextAttr)  *)
  3400.     pens * : ARRAY 2 OF SHORTINT;        (* color of text/background             *)
  3401.     activePens * : ARRAY 2 OF SHORTINT;  (* colors when gadget is active         *)
  3402.  
  3403.     (* edit specifications      *)
  3404.     initialMode * : LONGSET;             (* inital mode flags, below             *)
  3405.     editHook * : u.HookPtr;              (* if non-NULL, must supply WorkBuffer  *)
  3406.     workBuffer * : e.APTR;               (* must be as large as StringInfo.Buffer*)
  3407.  
  3408.     reserved * : ARRAY 4 OF LONGINT;     (* set to 0                             *)
  3409.   END;
  3410.  
  3411.   SGWork * = STRUCT
  3412.     (* set up when gadget is first activated    *)
  3413.     gadget * : GadgetDummyPtr;     (* the contestant itself        *)
  3414.     stringInfo * : StringInfoPtr;  (* easy access to sinfo         *)
  3415.     workBuffer * : e.APTR;         (* intuition's planned result   *)
  3416.     prevBuffer * : e.APTR;         (* what was there before        *)
  3417.     modes * : LONGSET;             (* current mode                 *)
  3418.  
  3419.     (* modified for each input event    *)
  3420.     iEvent * : ie.InputEventDummyPtr;(* actual event: do not change*)
  3421.     code * : INTEGER;              (* character code, if one byte  *)
  3422.     bufferPos * : INTEGER;         (* cursor position              *)
  3423.     numChars * : INTEGER;
  3424.     actions * : LONGSET;           (* what Intuition will do       *)
  3425.     longInt * : LONGINT;           (* temp storage for longint     *)
  3426.  
  3427.     gadgetInfo * : GadgetInfoPtr;  (* see cghooks.h                *)
  3428.     editOp * : INTEGER;            (* from constants below         *)
  3429.   END;
  3430.  
  3431. CONST
  3432.  
  3433. (* SGWork.editOp -
  3434.  * These values indicate what basic type of operation the global
  3435.  * editing hook has performed on the string before your gadget's custom
  3436.  * editing hook gets called.  You do not have to be concerned with the
  3437.  * value your custom hook leaves in the EditOp field, only if you
  3438.  * write a global editing hook.
  3439.  *
  3440.  * For most of these general edit operations, you'll want to compare
  3441.  * the BufferPos and NumChars of the StringInfo (before global editing)
  3442.  * and SGWork (after global editing).
  3443.  *)
  3444.  
  3445.   eoNoOp        * = 01H; (* did nothing                                                  *)
  3446.   eoDelBackward * = 02H; (* deleted some chars (maybe 0).                                *)
  3447.   eoDelForward  * = 03H; (* deleted some characters under and in front of the cursor     *)
  3448.   eoMoveCursor  * = 04H; (* moved the cursor                                             *)
  3449.   eoEnter       * = 05H; (* "enter" or "return" key, terminate                           *)
  3450.   eoReset       * = 06H; (* current Intuition-style undo                                 *)
  3451.   eoReplaceChar * = 07H; (* replaced one character and (maybe) advanced cursor           *)
  3452.   eoInsertChar  * = 08H; (* inserted one char into string or added one at end            *)
  3453.   eoBadFormat   * = 09H; (* didn't like the text data, e.g., Bad LONGINT                 *)
  3454.   eoBigChange   * = 0AH; (* complete or major change to the text, e.g. new string        *) (* unused by Intuition  *)
  3455.   eoUndo        * = 0BH; (* some other style of undo                                     *) (* unused by Intuition  *)
  3456.   eoClear       * = 0CH; (* clear the string                                             *)
  3457.   eoSpecial     * = 0DH; (* some operation that doesn't fit into the categories here     *) (* unused by Intuition  *)
  3458.  
  3459.  
  3460. (* Mode Flags definitions (ONLY first group allowed as InitialModes)    *)
  3461.   sgmReplace     * = 0;          (* replace mode                 *)
  3462. (* please initialize StringInfo with in-range value of BufferPos
  3463.  * if you are using sgmREPLACE mode.
  3464.  *)
  3465.  
  3466.   sgmFixedField  * = 1;          (* fixed length buffer          *)
  3467.                                         (* always set sgmREPLACE, too  *)
  3468.   sgmNoFilter    * = 2;          (* don't filter control chars   *)
  3469.  
  3470. (* SGM_EXITHELP is new for V37, and ignored by V36: *)
  3471.   sgmExitHelp    * = 7;          (* exit with code = 0x5F if HELP hit *)
  3472.  
  3473.  
  3474. (* These Mode Flags are for internal use only                           *)
  3475.   sgmNoChange    * = 3;          (* no edit changes yet          *)
  3476.   sgmNoWorkB     * = 4;          (* Buffer == PrevBuffer         *)
  3477.   sgmControl     * = 5;          (* control char escape mode     *)
  3478.   sgmLongint     * = 6;          (* an intuition longint gadget  *)
  3479.  
  3480. (* String Gadget Action Flags (put in SGWork.Actions by EditHook)       *)
  3481.   sgaUse         * = 0;  (* use contents of SGWork               *)
  3482.   sgaEnd         * = 1;  (* terminate gadget, code in Code field *)
  3483.   sgaBeep        * = 2;  (* flash the screen for the user        *)
  3484.   sgaReuse       * = 3;  (* reuse input event                    *)
  3485.   sgaRedisplay   * = 4;  (* gadget visuals changed               *)
  3486.  
  3487. (* New for V37: *)
  3488.   sgaNextActive  * = 5;  (* Make next possible gadget active.    *)
  3489.   sgaPrevActive  * = 6;  (* Make previous possible gadget active.*)
  3490.  
  3491. (* function id for only existing custom string gadget edit hook *)
  3492.  
  3493.   sghKey         * = 1;  (* process editing keystroke            *)
  3494.   sghClick       * = 2;  (* process mouse click cursor position  *)
  3495.  
  3496. (* Here's a brief summary of how the custom string gadget edit hook works:
  3497.  *    You provide a hook in StringInfo.Extension.EditHook.
  3498.  *    The hook is called in the standard way with the 'object'
  3499.  *    a pointer to SGWork, and the 'message' a pointer to a command
  3500.  *    block, starting either with (longword) sghKEY, sghCLICK,
  3501.  *    or something new.
  3502.  *
  3503.  *    You return 0 if you don't understand the command (sghKEY is
  3504.  *    required and assumed).  Return non-zero if you implement the
  3505.  *    command.
  3506.  *
  3507.  * sghKEY:
  3508.  *
  3509.  *    There are no parameters following the command longword.
  3510.  *
  3511.  *    Intuition will put its idea of proper values in the SGWork
  3512.  *    before calling you, and if you leave sgaUSE set in the
  3513.  *    SGWork.Actions field, Intuition will use the values
  3514.  *    found in SGWork fields WorkBuffer, NumChars, BufferPos,
  3515.  *    and LongInt, copying the WorkBuffer back to the StringInfo
  3516.  *    Buffer.
  3517.  *
  3518.  *    NOTE WELL: You may NOT change other SGWork fields.
  3519.  *
  3520.  *    If you clear sgaUSE, the string gadget will be unchanged.
  3521.  *
  3522.  *    If you set sgaEND, Intuition will terminate the activation
  3523.  *    of the string gadget.  If you also set sgaREUSE, Intuition
  3524.  *    will reuse the input event after it deactivates your gadget.
  3525.  *
  3526.  *    In this case, Intuition will put the value found in SGWork.Code
  3527.  *    into the IntuiMessage.Code field of the IDCMP_GADGETUP message it
  3528.  *    sends to the application.
  3529.  *
  3530.  *    If you set sgaBEEP, Intuition will call DisplayBeep(); use
  3531.  *    this if the user has typed in error, or buffer is full.
  3532.  *
  3533.  *    Set sgaREDISPLAY if the changes to the gadget warrant a
  3534.  *    gadget redisplay.  Note: cursor movement requires a redisplay.
  3535.  *
  3536.  *    Starting in V37, you may set SGA_PREVACTIVE or SGA_NEXTACTIVE
  3537.  *    when you set SGA_END.  This tells Intuition that you want
  3538.  *    the next or previous gadget with GFLG_TABCYCLE to be activated.
  3539.  *
  3540.  * sghCLICK:
  3541.  *    This hook command is called when Intuition wants to position
  3542.  *    the cursor in response to a mouse click in the string gadget.
  3543.  *
  3544.  *    Again, here are no parameters following the command longword.
  3545.  *
  3546.  *    This time, Intuition has already calculated the mouse position
  3547.  *    character cell and put it in SGWork.BufferPos.  The previous
  3548.  *    BufferPos value remains in the SGWork.StringInfo.BufferPos.
  3549.  *
  3550.  *    Intuition will again use the SGWork fields listed above for
  3551.  *    sghKEY.  One restriction is that you are NOT allowed to set
  3552.  *    sgaEND or sgaREUSE for this command.  Intuition will not
  3553.  *    stand for a gadget which goes inactive when you click in it.
  3554.  *
  3555.  *    You should always leave the sgaREDISPLAY flag set, since Intuition
  3556.  *    uses this processing when activating a string gadget.
  3557.  *)
  3558.  
  3559. (* IntuitionBase: *)
  3560.  
  3561. (* these are the display modes for which we have corresponding parameter
  3562.  *  settings in the config arrays
  3563.  *)
  3564.   dModeCount    * = 2;    (* how many modes there are *)
  3565.   hiresPick     * = 0;
  3566.   lowresPick    * = 1;
  3567.  
  3568.   eventMax * = 10;        (* size of event array *)
  3569.  
  3570. (* these are the system Gadget defines *)
  3571.   resCount      * = 2;
  3572.   hiresGadget   * = 0;
  3573.   lowresGadget  * = 1;
  3574.  
  3575.   gadgetCount     * = 8;
  3576.   upFrontGadget   * = 0;
  3577.   downBackGadget  * = 1;
  3578.   sizeGadget      * = 2;
  3579.   closeGadget     * = 3;
  3580.   dragGadget      * = 4;
  3581.   sUpFrontGadget  * = 5;
  3582.   sDownBackGadget * = 6;
  3583.   sDragGadget     * = 7;
  3584.  
  3585.  
  3586. (* ======================================================================== *)
  3587. (* === IntuitionBase ====================================================== *)
  3588. (* ======================================================================== *)
  3589. (*
  3590.  * Be sure to protect yourself against someone modifying these data as
  3591.  * you look at them.  This is done by calling:
  3592.  *
  3593.  * lock = LockIBase(0), which returns a ULONG.  When done call
  3594.  * UnlockIBase(lock) where lock is what LockIBase() returned.
  3595.  *)
  3596.  
  3597. TYPE
  3598.  
  3599. (* This structure is strictly READ ONLY *)
  3600.   IntuitionBase * = STRUCT (libNode - : e.Library)
  3601.  
  3602.     viewLord - : g.View;
  3603.  
  3604.     activeWindow - : WindowPtr;
  3605.     activeScreen - : ScreenPtr;
  3606.  
  3607.     (* the FirstScreen variable points to the frontmost Screen.  Screens are
  3608.      * then maintained in a front to back order using Screen.NextScreen
  3609.      *)
  3610.     firstScreen - : ScreenPtr; (* for linked list of all screens *)
  3611.  
  3612.     flags   : LONGSET;         (* values are all system private *)
  3613.     mouseY - , mouseX - : INTEGER;
  3614.                                (* note "backwards" order of these              *)
  3615.  
  3616.     time - : t.TimeVal         (* timestamp of most current input event *)
  3617.  
  3618.     (* I told you this was private.
  3619.      * The data beyond this point has changed, is changing, and
  3620.      * will continue to change.
  3621.      *)
  3622.  
  3623.   END;
  3624.  
  3625. (* Boolean Parameters must be 4 Bytes long: *)
  3626.  
  3627. TYPE
  3628.   LONGBOOL * = e.LONGBOOL;
  3629.  
  3630. CONST
  3631.   LTRUE  * = e.LTRUE;
  3632.   LFALSE * = e.LFALSE;
  3633.  
  3634.  
  3635. VAR
  3636.  int *, base * : IntuitionBasePtr;
  3637.  
  3638.  
  3639. PROCEDURE OpenIntuition  *{int,- 30}();
  3640. PROCEDURE Intuition      *{int,- 36}(iEvent{8}        : ie.InputEventDummyPtr);
  3641. PROCEDURE AddGadget      *{int,- 42}(window{8}        : WindowPtr;
  3642.                                      VAR gadget{9}    : Gadget;
  3643.                                      position{0}      : LONGINT): INTEGER;
  3644. PROCEDURE ClearDMRequest *{int,- 48}(window{8}        : WindowPtr): BOOLEAN;
  3645. PROCEDURE ClearMenuStrip *{int,- 54}(window{8}        : WindowPtr);
  3646. PROCEDURE ClearPointer   *{int,- 60}(window{8}        : WindowPtr);
  3647. PROCEDURE CloseScreen    *{int,- 66}(screen{8}        : ScreenPtr): BOOLEAN;
  3648. PROCEDURE OldCloseScreen *{int,- 66}(screen{8}        : ScreenPtr); (* version<36 had no result *)
  3649. PROCEDURE CloseWindow    *{int,- 72}(window{8}        : WindowPtr);
  3650. PROCEDURE CloseWorkBench *{int,- 78}(): BOOLEAN;
  3651. PROCEDURE CurrentTime    *{int,- 84}(VAR seconds{8}   : LONGINT;
  3652.                                      VAR micros{9}    : LONGINT);
  3653. PROCEDURE DisplayAlert   *{int,- 90}(alertNumber{0}   : LONGINT;
  3654.                                      string{8}        : ARRAY OF CHAR;
  3655.                                      height{1}        : LONGINT): BOOLEAN;
  3656. PROCEDURE DisplayBeep    *{int,- 96}(screen{8}        : ScreenPtr);
  3657. PROCEDURE DoubleClick    *{int,-102}(sSeconds{0}      : LONGINT;
  3658.                                      sMicros{1}       : LONGINT;
  3659.                                      cSeconds{2}      : LONGINT;
  3660.                                      cMicros{3}       : LONGINT): BOOLEAN;
  3661. PROCEDURE DrawBorder     *{int,-108}(rp{8}            : g.RastPortPtr;
  3662.                                      border{9}        : BorderPtr;
  3663.                                      leftOffset{0}    : LONGINT;
  3664.                                      topOffset{1}     : LONGINT);
  3665. PROCEDURE DrawImage      *{int,-114}(rp{8}            : g.RastPortPtr;
  3666.                                      image{9}         : Image;
  3667.                                      leftOffset{0}    : LONGINT;
  3668.                                      topOffset{1}     : LONGINT);
  3669. PROCEDURE EndRequest     *{int,-120}(requester{8}     : RequesterPtr;
  3670.                                      window{9}        : WindowPtr);
  3671. PROCEDURE GetDefPrefs    *{int,-126}(VAR preferences{8} : ARRAY OF e.BYTE;
  3672.                                      size{0}          : LONGINT);
  3673. PROCEDURE GetPrefs       *{int,-132}(VAR preferences{8} : ARRAY OF e.BYTE;
  3674.                                      size{0}          : LONGINT);
  3675. PROCEDURE InitRequester  *{int,-138}(VAR requester{8} : Requester);
  3676. PROCEDURE ItemAddress    *{int,-144}(menuStrip{8}     : Menu;
  3677.                                      menuNumber{0}    : LONGINT):  MenuItemPtr;
  3678. PROCEDURE ModifyIDCMP    *{int,-150}(window{8}        : WindowPtr;
  3679.                                      flags{0}         : LONGSET): BOOLEAN;
  3680. PROCEDURE OldModifyIDCMP *{int,-150}(window{8}        : WindowPtr;
  3681.                                      flags{0}         : LONGSET);
  3682. PROCEDURE ModifyProp     *{int,-156}(VAR gadget{8}    : Gadget;
  3683.                                      window{9}        : WindowPtr;
  3684.                                      requester{10}    : RequesterPtr;
  3685.                                      flags{0}         : SET;
  3686.                                      horizPot{1}      : LONGINT;
  3687.                                      vertPot{2}       : LONGINT;
  3688.                                      horizBody{3}     : LONGINT;
  3689.                                      vertBody{4}      : LONGINT);
  3690. PROCEDURE MoveScreen     *{int,-162}(screen{8}        : ScreenPtr;
  3691.                                      dx{0}            : LONGINT;
  3692.                                      dy{1}            : LONGINT);
  3693. PROCEDURE MoveWindow     *{int,-168}(window{8}        : WindowPtr;
  3694.                                      dx{0}            : LONGINT;
  3695.                                      dy{1}            : LONGINT);
  3696. PROCEDURE OffGadget      *{int,-174}(VAR gadget{8}    : Gadget;
  3697.                                      window{9}        : WindowPtr;
  3698.                                      requester{10}    : RequesterPtr);
  3699. PROCEDURE OffMenu        *{int,-180}(window{8}        : WindowPtr;
  3700.                                      menuNumber{0}    : LONGINT);
  3701. PROCEDURE OnGadget       *{int,-186}(VAR gadget{8}    : Gadget;
  3702.                                      window{9}        : WindowPtr;
  3703.                                      requester{10}    : RequesterPtr);
  3704. PROCEDURE OnMenu         *{int,-192}(window{8}        : WindowPtr;
  3705.                                      menuNumber{0}    : LONGINT);
  3706. PROCEDURE OpenScreen     *{int,-198}(newScreen{8}     : NewScreen): ScreenPtr;
  3707. PROCEDURE OpenWindow     *{int,-204}(newWindow{8}     : NewWindow ): WindowPtr;
  3708. PROCEDURE OpenWorkBench  *{int,-210}(): ScreenPtr;
  3709. PROCEDURE PrintIText     *{int,-216}(rp{8}            : g.RastPortPtr;
  3710.                                      iText{9}         : IntuiText;
  3711.                                      left{0}          : LONGINT;
  3712.                                      top{1}           : LONGINT);
  3713. PROCEDURE RefreshGadgets *{int,-222}(gadgets{8}       : GadgetDummyPtr;
  3714.                                      window{9}        : WindowPtr;
  3715.                                      requester{10}    : RequesterPtr);
  3716. PROCEDURE RemoveGadget   *{int,-228}(window{8}        : WindowPtr;
  3717.                                      VAR gadget{9}    : Gadget): INTEGER;
  3718. PROCEDURE ReportMouse    *{int,-234}(window{8}        : WindowPtr;
  3719.                                      flag{0}          : LONGBOOL);
  3720. PROCEDURE Request        *{int,-240}(requester{8}     : RequesterPtr;
  3721.                                      window{9}        : WindowPtr ): BOOLEAN;
  3722. PROCEDURE ScreenToBack   *{int,-246}(screen{8}        : ScreenPtr);
  3723. PROCEDURE ScreenToFront  *{int,-252}(screen{8}        : ScreenPtr);
  3724. PROCEDURE SetDMRequest   *{int,-258}(window{8}        : WindowPtr;
  3725.                                      requester{9}     : RequesterPtr): BOOLEAN;
  3726. PROCEDURE SetMenuStrip   *{int,-264}(window{8}        : WindowPtr;
  3727.                                      VAR menu{9}      : Menu): BOOLEAN;
  3728. PROCEDURE SetPointer     *{int,-270}(window{8}        : WindowPtr;
  3729.                                      pointer{9}       : ARRAY OF e.BYTE;
  3730.                                      height{0}        : LONGINT;
  3731.                                      width{1}         : LONGINT;
  3732.                                      xOffset{2}       : LONGINT;
  3733.                                      yOffset{3}       : LONGINT);
  3734. PROCEDURE SetWindowTitles*{int,-276}(window{8}        : WindowPtr;
  3735.                                      windowTitle{9}   : e.ADDRESS;
  3736.                                      screenTitle{10}  : e.ADDRESS);
  3737. PROCEDURE SetWindowTitlesStr*{int,-276}(window{8}        : WindowPtr;
  3738.                                      windowTitle{9}   : ARRAY OF CHAR;
  3739.                                      screenTitle{10}  : ARRAY OF CHAR);
  3740. PROCEDURE ShowTitle      *{int,-282}(screen{8}        : ScreenPtr;
  3741.                                      showIt{0}        : LONGBOOL);
  3742. PROCEDURE SizeWindow     *{int,-288}(window{8}        : WindowPtr;
  3743.                                      dx{0}            : LONGINT;
  3744.                                      dy{1}            : LONGINT);
  3745. PROCEDURE ViewAddress    *{int,-294}(): g.ViewPtr;
  3746. PROCEDURE ViewPortAddress*{int,-300}(window{8}        : WindowPtr): g.ViewPortPtr;
  3747. PROCEDURE WindowToBack   *{int,-306}(window{8}        : WindowPtr);
  3748. PROCEDURE WindowToFront  *{int,-312}(window{8}        : WindowPtr);
  3749. PROCEDURE WindowLimits   *{int,-318}(window{8}        : WindowPtr;
  3750.                                      widthMin{0}      : LONGINT;
  3751.                                      heightMin{1}     : LONGINT;
  3752.                                      widthMax{2}      : LONGINT;
  3753.                                      heightMax{3}     : LONGINT): BOOLEAN;
  3754. (*--- start of next generation of names -------------------------------------*)
  3755. PROCEDURE SetPrefs       *{int,-324}(preferences{8}   : ARRAY OF e.BYTE;
  3756.                                      size{0}          : LONGINT;
  3757.                                      inform{1}        : LONGBOOL);
  3758. (*--- start of next next generation of names --------------------------------*)
  3759. PROCEDURE IntuiTextLength*{int,-330}(iText{8}         : IntuiText): INTEGER;
  3760. PROCEDURE WBenchToBack   *{int,-336}(): BOOLEAN;
  3761. PROCEDURE WBenchToFront  *{int,-342}(): BOOLEAN;
  3762. (*--- start of next next next generation of names ---------------------------*)
  3763. PROCEDURE AutoRequest    *{int,-348}(window{8}        : WindowPtr;
  3764.                                      body{9}          : IntuiTextPtr;
  3765.                                      posText{10}      : IntuiTextPtr;
  3766.                                      negText{11}      : IntuiTextPtr;
  3767.                                      pFlag{0}         : LONGSET;
  3768.                                      nFlag{1}         : LONGSET;
  3769.                                      width{2}         : LONGINT;
  3770.                                      height{3}        : LONGINT): BOOLEAN;
  3771. PROCEDURE BeginRefresh   *{int,-354}(window{8}        : WindowPtr);
  3772. PROCEDURE BuildSysRequest*{int,-360}(window{8}        : WindowPtr;
  3773.                                      body{9}          : IntuiTextPtr;
  3774.                                      posText{10}      : IntuiTextPtr;
  3775.                                      negText{11}      : IntuiTextPtr;
  3776.                                      flags{0}         : LONGSET;
  3777.                                      width{1}         : LONGINT;
  3778.                                      height{2}        : LONGINT): WindowPtr;
  3779. PROCEDURE EndRefresh     *{int,-366}(window{8}        : WindowPtr;
  3780.                                      complete{0}      : LONGBOOL);
  3781. PROCEDURE FreeSysRequest *{int,-372}(window{8}        : WindowPtr);
  3782. PROCEDURE OldMakeScreen     *{int,-378}(screen{8}        : ScreenPtr);
  3783. PROCEDURE OldRemakeDisplay  *{int,-384}();
  3784. PROCEDURE OldRethinkDisplay *{int,-390}();
  3785. (* The return codes for MakeScreen(), RemakeDisplay(), and RethinkDisplay() *)
  3786. (* are only valid under V39 and greater.  Do not examine them when running *)
  3787. (* on pre-V39 systems! *)
  3788. PROCEDURE MakeScreen     *{int,-378}(screen{8}        : ScreenPtr): LONGINT;
  3789. PROCEDURE RemakeDisplay  *{int,-384}(): LONGINT;
  3790. PROCEDURE RethinkDisplay *{int,-390}(): LONGINT;
  3791. (*--- start of next next next next generation of names ----------------------*)
  3792. PROCEDURE AllocRemember  *{int,-396}(VAR rememberKey{8} : RememberPtr;
  3793.                                      size{0}          : LONGINT;
  3794.                                      flags{1}         : LONGSET): e.APTR;
  3795. PROCEDURE AlohaWorkbench *{int,-402}(wbport{8}        : e.MsgPortPtr);
  3796. PROCEDURE FreeRemember   *{int,-408}(VAR rememberKey{8} : RememberPtr;
  3797.                                      reallyForget{0}  : LONGBOOL);
  3798. (*--- start of 15 Nov 85 names ------------------------*)
  3799. PROCEDURE LockIBase      *{int,-414}(dontknow{0}      : LONGINT): LONGINT;
  3800. PROCEDURE UnlockIBase    *{int,-420}(ibLock{8}        : LONGINT);
  3801. (*--- functions in V33 or higher (Release 1.2) ---*)
  3802. PROCEDURE GetScreenData  *{int,-426}(VAR buffer{8}    : Screen;
  3803.                                      size{0}          : LONGINT;
  3804.                                      type{1}          : SET;
  3805.                                      screen{9}        : ScreenPtr): BOOLEAN;
  3806. PROCEDURE RefreshGList   *{int,-432}(gadgets{8}       : GadgetDummyPtr;
  3807.                                      window{9}        : WindowPtr;
  3808.                                      requester{10}    : RequesterPtr;
  3809.                                      numGad{0}        : LONGINT);
  3810. PROCEDURE AddGList       *{int,-438}(window{8}        : WindowPtr;
  3811.                                      gadget{9}        : GadgetDummyPtr;
  3812.                                      position{0}      : LONGINT;
  3813.                                      numGad{1}        : LONGINT;
  3814.                                      requester{10}    : RequesterPtr): INTEGER;
  3815. PROCEDURE RemoveGList    *{int,-444}(remPtr{8}        : WindowPtr;
  3816.                                      gadget{9}        : GadgetDummyPtr;
  3817.                                      numGad{0}        : LONGINT): INTEGER;
  3818. PROCEDURE ActivateWindow *{int,-450}(window{8}        : WindowPtr); (* no result, even for V36+ *)
  3819. PROCEDURE RefreshWindowFrame*{int,-456}(window{8}     : WindowPtr);
  3820. PROCEDURE ActivateGadget *{int,-462}(VAR gadget{8}    : Gadget;
  3821.                                      window{9}        : WindowPtr;
  3822.                                      requester{10}    : RequesterPtr): BOOLEAN;
  3823. PROCEDURE NewModifyProp  *{int,-468}(VAR gadget{8}    : Gadget;
  3824.                                      window{9}        : WindowPtr;
  3825.                                      requester{10}    : RequesterPtr;
  3826.                                      flags{0}         : SET;
  3827.                                      horizPot{1}      : LONGINT;
  3828.                                      vertPot{2}       : LONGINT;
  3829.                                      horizBody{3}     : LONGINT;
  3830.                                      vertBody{4}      : LONGINT;
  3831.                                      numGad{5}        : LONGINT);
  3832. (*--- functions in V36 or higher (Release 2.0) ---*)
  3833. (*---     REMEMBER: You are to check int.libNode.version !    ---*)
  3834. PROCEDURE QueryOverscan  *{int,-474}(displayID{8}     : LONGINT;
  3835.                                      VAR rect{9}      : g.Rectangle;
  3836.                                      oScanType{0}     : LONGINT): LONGINT;
  3837. PROCEDURE MoveWindowInFrontOf*{int,-480}(window{8}    : WindowPtr;
  3838.                                          behindWin{9} : WindowPtr);
  3839. PROCEDURE ChangeWindowBox*{int,-486}(window{8}        : WindowPtr;
  3840.                                      left{0}          : LONGINT;
  3841.                                      top{1}           : LONGINT;
  3842.                                      width{2}         : LONGINT;
  3843.                                      height{3}        : LONGINT);
  3844. PROCEDURE SetEditHook    *{int,-492}(hook{8}          : u.HookPtr): u.HookPtr;
  3845. PROCEDURE SetMouseQueue  *{int,-498}(window{8}        : LONGINT;
  3846.                                      queueLength{0}   : LONGINT): LONGINT;
  3847. PROCEDURE ZipWindow      *{int,-504}(window{8}        : WindowPtr);
  3848. (*--- public screens ---*)
  3849. PROCEDURE LockPubScreen  *{int,-510}(name{8}          : ARRAY OF CHAR): ScreenPtr;
  3850. PROCEDURE UnlockPubScreen*{int,-516}(name{8}          : ARRAY OF CHAR;
  3851.                                      screen{9}        : ScreenPtr);
  3852. PROCEDURE LockPubScreenList*{int,-522}(): e.ListPtr;
  3853. PROCEDURE UnlockPubScreenList*{int,-528}();
  3854. PROCEDURE NextPubScreen  *{int,-534}(screen{8}        : ScreenPtr;
  3855.                                      VAR name{9}      : ARRAY OF CHAR): e.LSTRPTR;
  3856. PROCEDURE SetDefaultPubScreen*{int,-540}(name{8}      : ARRAY OF CHAR);
  3857. PROCEDURE SetPubScreenModes*{int,-546}(modes{0}       : SET): SET;
  3858. PROCEDURE PubScreenStatus*{int,-552}(screen{8}        : ScreenPtr;
  3859.                                      statusFlags{0}   : SET): SET;
  3860. (**)
  3861. PROCEDURE ObtainGIRPort  *{int,-558}(gInfo{8}         : GadgetInfoPtr): g.RastPortPtr;
  3862. PROCEDURE ReleaseGIRPort *{int,-564}(rp{8}            : g.RastPortPtr);
  3863. PROCEDURE GadgetMouse    *{int,-570}(VAR gadget{8}    : Gadget;
  3864.                                      gInfo{9}         : GadgetInfoPtr;
  3865.                                      VAR mousePoint{10} : g.Point);
  3866. (* SetIPrefs is system private and not to be used by applications *)
  3867. PROCEDURE SetIPrefs       {int,-576}(ptr{8}           : e.APTR;
  3868.                                      size{0}          : LONGINT;
  3869.                                      type{1}          : LONGINT);
  3870. PROCEDURE GetDefaultPubScreen*{int,-582}(VAR nameBuffer{8} : ARRAY OF CHAR);
  3871. PROCEDURE EasyRequestArgs*{int,-588}(window{8}        : WindowPtr;
  3872.                                      easyStruct{9}    : EasyStructPtr;
  3873.                                      idcmpPtr{10}     : e.APTR;
  3874.                                      args{11}         : e.APTR): LONGINT;
  3875. PROCEDURE EasyRequest    *{int,-588}(window{8}        : WindowPtr;
  3876.                                      easyStruct{9}    : EasyStructPtr;
  3877.                                      idcmpPtr{10}     : e.APTR;
  3878.                                      arg1{11}..       : e.APTR): LONGINT;
  3879. PROCEDURE BuildEasyRequestArgs*{int,-594}(window{8}   : WindowPtr;
  3880.                                      easyStruct{9}    : EasyStructPtr;
  3881.                                      idcmp{0}         : LONGSET;
  3882.                                      args{11}         : e.APTR): WindowPtr;
  3883. PROCEDURE BuildEasyRequest*{int,-594}(window{8}       : WindowPtr;
  3884.                                      easyStruct{9}    : EasyStructPtr;
  3885.                                      idcmp{0}         : LONGSET;
  3886.                                      arg1{11}..       : e.APTR): WindowPtr;
  3887. PROCEDURE SysReqHandler  *{int,-600}(window{8}        : WindowPtr;
  3888.                                      idcmpPtr{9}      : e.APTR;
  3889.                                      waitInput{0}     : LONGBOOL): LONGINT;
  3890. PROCEDURE OpenWindowTagList*{int,-606}(newWindow{8}   : NewWindow;
  3891.                                      tagList{9}       : ARRAY OF u.TagItem): WindowPtr;
  3892. PROCEDURE OpenWindowTags *{int,-606}(newWindow{8}     : NewWindow;
  3893.                                      tag1{9}..        : u.Tag): WindowPtr;
  3894. PROCEDURE OpenWindowTagListA*{int,-606}(newWindow{8}  : NewWindowPtr;
  3895.                                      tagList{9}       : ARRAY OF u.TagItem): WindowPtr;
  3896. PROCEDURE OpenWindowTagsA *{int,-606}(newWindow{8}    : NewWindowPtr;
  3897.                                      tag1{9}..        : u.Tag): WindowPtr;
  3898. PROCEDURE OpenScreenTagList*{int,-612}(newScreen{8}   : NewScreen;
  3899.                                      tagList{9}       : ARRAY OF u.TagItem): ScreenPtr;
  3900. PROCEDURE OpenScreenTags *{int,-612}(newScreen{8}     : NewScreen;
  3901.                                      tag1{9}..        : u.Tag): ScreenPtr;
  3902. PROCEDURE OpenScreenTagListA*{int,-612}(newScreen{8}   : NewScreenPtr;
  3903.                                      tagList{9}       : ARRAY OF u.TagItem): ScreenPtr;
  3904. PROCEDURE OpenScreenTagsA *{int,-612}(newScreen{8}     : NewScreenPtr;
  3905.                                      tag1{9}..        : u.Tag): ScreenPtr;
  3906. (**)
  3907. (*      new Image functions *)
  3908. PROCEDURE DrawImageState *{int,-618}(rp{8}            : g.RastPortPtr;
  3909.                                      image{9}         : Image;
  3910.                                      leftOffset{0}    : LONGINT;
  3911.                                      topOffset{1}     : LONGINT;
  3912.                                      state{2}         : LONGINT;
  3913.                                      drawInfo{10}     : DrawInfoPtr);
  3914. PROCEDURE PointInImage   *{int,-624}(point{0}         : LONGINT;
  3915.                                      image{8}         : Image): BOOLEAN;
  3916. PROCEDURE EraseImage     *{int,-630}(rp{8}            : g.RastPortPtr;
  3917.                                      image{9}         : Image;
  3918.                                      leftOffset{0}    : LONGINT;
  3919.                                      topOffset{1}     : LONGINT);
  3920. (**)
  3921. PROCEDURE NewObjectA     *{int,-636}(clacc{8}         : IClassPtr;
  3922.                                      classID{9}       : ARRAY OF CHAR;
  3923.                                      tagList{10}      : ARRAY OF u.TagItem): e.APTR;
  3924. PROCEDURE NewObject      *{int,-636}(clacc{8}         : IClassPtr;
  3925.                                      classID{9}       : ARRAY OF CHAR;
  3926.                                      tag1{10}..       : u.Tag): e.APTR;
  3927. (**)
  3928. PROCEDURE DisposeObject  *{int,-642}(object{8}        : e.APTR);
  3929. PROCEDURE SetAttrsA      *{int,-648}(object{8}        : e.APTR;
  3930.                                      tagList{9}       : ARRAY OF u.TagItem): LONGINT;
  3931. PROCEDURE SetAttrs       *{int,-648}(object{8}        : e.APTR;
  3932.                                      tag1{9}..        : u.Tag): LONGINT;
  3933. (**)
  3934. PROCEDURE GetAttr        *{int,-654}(attrID{0}        : LONGINT;
  3935.                                      object{8}        : e.APTR;
  3936.                                      VAR storage{9}   : ARRAY OF e.BYTE): LONGINT;
  3937. (**)
  3938. (*      special set attribute call for gadgets *)
  3939. PROCEDURE SetGadgetAttrsA*{int,-660}(VAR gadget{8}    : Gadget;
  3940.                                      window{9}        : WindowPtr;
  3941.                                      requester{10}    : RequesterPtr;
  3942.                                      tagList{11}      : ARRAY OF u.TagItem): LONGINT;
  3943. PROCEDURE SetGadgetAttrs *{int,-660}(VAR gadget{8}    : Gadget;
  3944.                                      window{9}        : WindowPtr;
  3945.                                      requester{10}    : RequesterPtr;
  3946.                                      tag1{11}..       : u.Tag): LONGINT;
  3947. (**)
  3948. (*      for class implementors only *)
  3949. PROCEDURE NextObject     *{int,-666}(VAR objectPtr{8} : ObjectPtr): e.APTR;
  3950. PROCEDURE FindClass      *{int,-672}(classID{8}       : ARRAY OF CHAR): IClassPtr;
  3951. PROCEDURE MakeClass      *{int,-678}(classID{8}       : ARRAY OF CHAR;
  3952.                                      superClassID{9}  : ARRAY OF CHAR;
  3953.                                      superClassPtr{10}: IClassPtr;
  3954.                                      instanceSize{0}  : LONGINT;
  3955.                                      flags{1}         : LONGSET): IClassPtr;
  3956. PROCEDURE AddClass       *{int,-684}(class{8}         : IClassPtr);
  3957. (**)
  3958. (**)
  3959. PROCEDURE GetScreenDrawInfo*{int,-690}(screen{8}      : ScreenPtr): DrawInfoPtr;
  3960. PROCEDURE FreeScreenDrawInfo*{int,-696}(screen{8}     : ScreenPtr;
  3961.                                      drawInfo{9}      : DrawInfoPtr);
  3962. (**)
  3963. PROCEDURE ResetMenuStrip *{int,-702}(window{8}        : WindowPtr;
  3964.                                      VAR menu{9}      : Menu): BOOLEAN;
  3965. PROCEDURE RemoveClass    *{int,-708}(classPtr{8}      : IClassPtr);
  3966. PROCEDURE FreeClass      *{int,-714}(classPtr{8}      : IClassPtr): BOOLEAN;
  3967.  
  3968. (*--- functions in V39 or higher (Release 3) ---*)
  3969. PROCEDURE AllocScreenBuffer *{int,-0300H}(sc{8}       : ScreenPtr;
  3970.                                           bm{9}       : g.BitMapPtr;
  3971.                                           flags{0}    : LONGSET): ScreenBufferPtr;
  3972. PROCEDURE FreeScreenBuffer  *{int,-0306H}(sc{8}       : ScreenPtr;
  3973.                                           sb{9}       : ScreenBufferPtr);
  3974. PROCEDURE ChangeScreenBuffer*{int,-030CH}(sc{8}       : ScreenPtr;
  3975.                                           sb{9}       : ScreenBufferPtr): BOOLEAN;
  3976. PROCEDURE ScreenDepth       *{int,-0312H}(screen{8}   : ScreenPtr;
  3977.                                           flags{0}    : LONGSET;
  3978.                                           reserved{9} : e.APTR);
  3979. PROCEDURE ScreenPosition    *{int,-0318H}(screen{8}   : ScreenPtr;
  3980.                                           flags{0}    : LONGSET;
  3981.                                           x1{1}       : LONGINT;
  3982.                                           y1{2}       : LONGINT;
  3983.                                           x2{3}       : LONGINT;
  3984.                                           y2{4}       : LONGINT);
  3985. PROCEDURE ScrollWindowRaster *{int,-031EH}(win{9}     : WindowPtr;
  3986.                                           dx{0}       : LONGINT;
  3987.                                           dy{1}       : LONGINT;
  3988.                                           xMin{2}     : LONGINT;
  3989.                                           yMin{3}     : LONGINT;
  3990.                                           xMax{4}     : LONGINT;
  3991.                                           yMax{5}     : LONGINT);
  3992. PROCEDURE LendMenus         *{int,-0324H}(fromWin{8}  : WindowPtr;
  3993.                                           toWindow{9} : WindowPtr);
  3994. PROCEDURE DoGadgetMethodA   *{int,-032AH}(gad{8}      : GadgetPtr;
  3995.                                           win{9}      : WindowPtr;
  3996.                                           eq{10}      : RequesterPtr;
  3997.                                           message{11} : Msg): LONGINT;
  3998. PROCEDURE DoGadgetMethod    *{int,-032AH}(gad{8}      : GadgetPtr;
  3999.                                           win{9}      : WindowPtr;
  4000.                                           req{10}     : RequesterPtr;
  4001.                                           MethodID{11}..: e.ADDRESS): LONGINT;
  4002. PROCEDURE SetWindowPointerA *{int,-0330H}(win{8}      : WindowPtr;
  4003.                                           taglist{9}  : ARRAY OF u.TagItem);
  4004. PROCEDURE SetWindowPointer  *{int,-0330H}(win{8}      : WindowPtr;
  4005.                                           tag1{9}..   : u.Tag);
  4006. PROCEDURE TimedDisplayAlert *{int,-0336H}(alertNum{0} : LONGINT;
  4007.                                           string{8}   : ARRAY OF CHAR;
  4008.                                           height{1}   : LONGINT;
  4009.                                           time{9}     : LONGINT): BOOLEAN;
  4010. PROCEDURE HelpControl       *{int,-033CH}(win{8}      : WindowPtr;
  4011.                                           flags{0}    : LONGSET);
  4012.  
  4013.  
  4014. (* === MACROS ============================================================ *)
  4015.  
  4016. (* $OvflChk- $RangeChk- $StackChk- $NilChk- $ReturnChk- $CaseChk- *)
  4017.  
  4018. PROCEDURE MenuNum * (n{0}: INTEGER): INTEGER;
  4019. BEGIN RETURN y.VAL(INTEGER,      y.VAL(SET,n)      * {0..4}) END MenuNum;
  4020.  
  4021. PROCEDURE ItemNum * (n{0}: INTEGER): INTEGER;
  4022. BEGIN RETURN y.VAL(INTEGER,y.LSH(y.VAL(SET,n),- 5) * {0..5}) END ItemNum;
  4023.  
  4024. PROCEDURE SubNum  * (n{0}: INTEGER): INTEGER;
  4025. BEGIN RETURN y.VAL(INTEGER,y.LSH(y.VAL(SET,n),-11) * {0..4}) END SubNum;
  4026.  
  4027.  
  4028. PROCEDURE ShiftMenu * (n{0}: INTEGER): INTEGER;
  4029. BEGIN RETURN y.VAL(INTEGER,      y.VAL(SET,n) * {0..4}    ) END ShiftMenu;
  4030.  
  4031. PROCEDURE ShiftItem * (n{0}: INTEGER): INTEGER;
  4032. BEGIN RETURN y.VAL(INTEGER,y.LSH(y.VAL(SET,n) * {0..5}, 5)) END ShiftItem;
  4033.  
  4034. PROCEDURE ShiftSub  * (n{0}: INTEGER): INTEGER;
  4035. BEGIN RETURN y.VAL(INTEGER,y.LSH(y.VAL(SET,n) * {0..4},11)) END ShiftSub;
  4036.  
  4037. PROCEDURE FullMenuNum * (menu, item, sub: INTEGER): INTEGER;
  4038. BEGIN RETURN ShiftMenu(menu) + ShiftItem(item) + ShiftSub(sub) END FullMenuNum;
  4039.  
  4040.  
  4041. (* Preferences.ser...: *)
  4042.  
  4043. PROCEDURE SRBNum  * (n{0}: e.BYTE): INTEGER; BEGIN RETURN 8 - ORD(n) DIV 16 END SRBNum;
  4044. PROCEDURE SWBNum  * (n{0}: e.BYTE): INTEGER; BEGIN RETURN 8 - ORD(n) MOD 16 END SWBNum;
  4045. PROCEDURE SSBNum  * (n{0}: e.BYTE): INTEGER; BEGIN RETURN 1 + ORD(n) DIV 16 END SSBNum;
  4046. PROCEDURE SPARNum * (n{0}: e.BYTE): INTEGER; BEGIN RETURN     ORD(n) DIV 16 END SPARNum;
  4047. PROCEDURE SHAKNum * (n{0}: e.BYTE): INTEGER; BEGIN RETURN     ORD(n) MOD 16 END SHAKNum;
  4048.  
  4049.  
  4050. (* this casts MutualExclude for easy assignment of a hook
  4051.  * pointer to the unused MutualExclude field of a custom gadget
  4052.  *)
  4053. PROCEDURE CustomHook * (VAR g{8}: Gadget): u.HookPtr;
  4054. BEGIN RETURN y.VAL(u.HookPtr,g.mutualExclude) END CustomHook;
  4055.  
  4056.  
  4057. (* some convenient macros and casts *)
  4058. PROCEDURE GadgetBox * (VAR g{8}: Gadget): IBoxPtr;  BEGIN RETURN y.ADR(g.leftEdge) END GadgetBox;
  4059. PROCEDURE IMBox     * (VAR i{8}: Image ): IBoxPtr;  BEGIN RETURN y.ADR(i.leftEdge) END IMBox;
  4060. PROCEDURE FGPen     * (VAR i{8}: Image ): SHORTINT; BEGIN RETURN y.VAL(SHORTINT,i.planePick ) END FGPen;
  4061. PROCEDURE BGPen     * (VAR i{8}: Image ): SHORTINT; BEGIN RETURN y.VAL(SHORTINT,i.planeOnOff) END BGPen;
  4062.  
  4063. (*-----------------------------------------------------------------------*)
  4064.  
  4065.  
  4066. (*------  Special:  ------*)
  4067.  
  4068. (* convert BOOLEANs to LONGBOOLs: *)
  4069.  
  4070. PROCEDURE BoolToLong*(b{0}: BOOLEAN): LONGBOOL;
  4071. BEGIN IF b THEN RETURN LTRUE ELSE RETURN LFALSE END
  4072. END BoolToLong;
  4073.  
  4074. (* Convert pseudo unsigned integers (like those within PropInfo) to
  4075.  * LONGINTs and vice versa:
  4076.  *)
  4077.  
  4078. PROCEDURE UIntToLong*(i{0}: INTEGER): LONGINT;
  4079. BEGIN
  4080.   IF i<0 THEN RETURN i+10000H
  4081.          ELSE RETURN i        END;
  4082. END UIntToLong;
  4083.  
  4084.  
  4085. PROCEDURE LongToUInt*(l{0}: LONGINT): INTEGER;
  4086. BEGIN
  4087. (* $RangeChk- Tricky: just return lower Word *)
  4088.   RETURN SHORT(l)
  4089. (* $RangeChk= *)
  4090. END LongToUInt;
  4091.  
  4092.  
  4093. (*-----------------------------------------------------------------------*)
  4094. (*
  4095.  * The following procedures are implemented for to avoid using SYSTEM within
  4096.  * Oberon programs.
  4097.  *)
  4098.  
  4099. PROCEDURE ScreenToRastPort*(s{8}: ScreenPtr): g.RastPortPtr;
  4100. BEGIN RETURN y.ADR(s.rastPort); END ScreenToRastPort;
  4101.  
  4102. PROCEDURE ScreenToViewPort*(s{8}: ScreenPtr): g.ViewPortPtr;
  4103. BEGIN RETURN y.ADR(s.viewPort); END ScreenToViewPort;
  4104.  
  4105. (*-----------------------------------------------------------------------*)
  4106.  
  4107. BEGIN
  4108.   int :=  e.OpenLibrary(intuitionName,33);
  4109.   IF int = NIL THEN HALT(20) END;
  4110.   base := int;
  4111.  
  4112. CLOSE
  4113.   IF int#NIL THEN e.CloseLibrary(int) END;
  4114.  
  4115. END Intuition.
  4116.  
  4117.